We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca6bbb7 commit a7dff89Copy full SHA for a7dff89
localflavor/se/models.py
@@ -42,13 +42,13 @@ class MyModel(models.Model):
42
43
def __init__(self, *args, **kwargs):
44
45
- if 'choices' not in kwargs:
46
- kwargs['choices'] = COUNTY_CHOICES
+ defaults = {
+ 'max_length': 2,
47
+ 'choices': COUNTY_CHOICES,
48
+ }
49
+ defaults.update(kwargs)
50
- if 'max_length' not in kwargs:
- kwargs['max_length'] = 2
-
51
- super(SECountyField, self).__init__(*args, **kwargs)
+ super(SECountyField, self).__init__(*args, **defaults)
52
53
def contribute_to_class(self, cls, name):
54
if not cls._meta.abstract:
0 commit comments