1
- import abc
1
+ from abc import ABCMeta
2
2
3
3
from django .db .models .base import ModelBase
4
- from six import string_types , with_metaclass
5
4
6
5
import querybuilder
7
6
from querybuilder .fields import FieldFactory
@@ -31,7 +30,7 @@ def __new__(cls, table, *args, **kwargs):
31
30
kwargs .update (alias = list (table .keys ())[0 ])
32
31
table = list (table .values ())[0 ]
33
32
table_type = type (table )
34
- if isinstance (table , string_types ):
33
+ if isinstance (table , str ):
35
34
return SimpleTable (table , ** kwargs )
36
35
elif issubclass (table_type , ModelBase ):
37
36
return ModelTable (table , ** kwargs )
@@ -44,7 +43,7 @@ def __new__(cls, table, *args, **kwargs):
44
43
return None
45
44
46
45
47
- class Table (with_metaclass ( abc . ABCMeta , object ) ):
46
+ class Table (object , metaclass = ABCMeta ):
48
47
"""
49
48
Abstract table class that all table types extend.
50
49
@@ -259,7 +258,7 @@ def add_fields(self, fields):
259
258
or ``Field`` instance
260
259
:type fields: str or tuple or list of str or list of Field or :class:`Field <querybuilder.fields.Field>`
261
260
"""
262
- if isinstance (fields , string_types ):
261
+ if isinstance (fields , str ):
263
262
fields = [fields ]
264
263
elif type (fields ) is tuple :
265
264
fields = list (fields )
0 commit comments