Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ColorField(models.CharField):
- description = "Stores a color value."
- __metaclass__ = models.SubfieldBase
- def __init__(self, *args, **kwargs):
- kwargs['max_length'] = 10
- super(ColorField, self).__init__(*args, **kwargs)
- def formfield(self, **kwargs):
- kwargs['widget'] = ColorWidget
- return super(ColorField, self).formfield(**kwargs)
- from south.modelsinspector import add_introspection_rules
- add_introspection_rules([], ["^dater\.models\.ColorField"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement