Skip to content

Commit

Permalink
Better defaults for SECountyField.
Browse files Browse the repository at this point in the history
  • Loading branch information
dessibelle committed Nov 21, 2014
1 parent ca6bbb7 commit a7dff89
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions localflavor/se/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ class MyModel(models.Model):

def __init__(self, *args, **kwargs):

if 'choices' not in kwargs:
kwargs['choices'] = COUNTY_CHOICES
defaults = {
'max_length': 2,
'choices': COUNTY_CHOICES,
}
defaults.update(kwargs)

if 'max_length' not in kwargs:
kwargs['max_length'] = 2

super(SECountyField, self).__init__(*args, **kwargs)
super(SECountyField, self).__init__(*args, **defaults)

def contribute_to_class(self, cls, name):
if not cls._meta.abstract:
Expand Down

0 comments on commit a7dff89

Please sign in to comment.