@@ -33,16 +33,16 @@ def __init__(self, salt=settings.HASHID_FIELD_SALT, min_length=7, alphabet=Hashi
33
33
allow_int_lookup = kwargs ['allow_int' ]
34
34
del kwargs ['allow_int' ]
35
35
self .allow_int_lookup = allow_int_lookup
36
- super (HashidFieldMixin , self ).__init__ (* args , ** kwargs )
36
+ super ().__init__ (* args , ** kwargs )
37
37
38
38
def deconstruct (self ):
39
- name , path , args , kwargs = super (HashidFieldMixin , self ).deconstruct ()
39
+ name , path , args , kwargs = super ().deconstruct ()
40
40
kwargs ['min_length' ] = self .min_length
41
41
kwargs ['alphabet' ] = self .alphabet
42
42
return name , path , args , kwargs
43
43
44
44
def check (self , ** kwargs ):
45
- errors = super (HashidFieldMixin , self ).check (** kwargs )
45
+ errors = super ().check (** kwargs )
46
46
errors .extend (self ._check_alphabet_min_length ())
47
47
errors .extend (self ._check_salt_is_set ())
48
48
return errors
@@ -91,7 +91,7 @@ def get_lookup(self, lookup_name):
91
91
if lookup_name in self .iterable_lookups :
92
92
return HashidIterableLookup
93
93
if lookup_name in self .passthrough_lookups :
94
- return super (HashidFieldMixin , self ).get_lookup (lookup_name )
94
+ return super ().get_lookup (lookup_name )
95
95
return None # Otherwise, we don't allow lookups of this type
96
96
97
97
def to_python (self , value ):
@@ -121,7 +121,7 @@ def get_prep_value(self, value):
121
121
return hashid .id
122
122
123
123
def contribute_to_class (self , cls , name , ** kwargs ):
124
- super (HashidFieldMixin , self ).contribute_to_class (cls , name , ** kwargs )
124
+ super ().contribute_to_class (cls , name , ** kwargs )
125
125
# setattr(cls, "_" + self.attname, getattr(cls, self.attname))
126
126
setattr (cls , self .attname , HashidDescriptor (self .attname , salt = self .salt , min_length = self .min_length , alphabet = self .alphabet ))
127
127
@@ -134,7 +134,7 @@ def formfield(self, **kwargs):
134
134
defaults .update (kwargs )
135
135
if defaults .get ('widget' ) == admin_widgets .AdminIntegerFieldWidget :
136
136
defaults ['widget' ] = admin_widgets .AdminTextInputWidget
137
- return super (HashidField , self ).formfield (** defaults )
137
+ return super ().formfield (** defaults )
138
138
139
139
140
140
class HashidAutoField (HashidFieldMixin , models .AutoField ):
0 commit comments