Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
| 1 |
from django.db.models import CharField |
| 2 |
|
| 3 |
from paintstore.widgets import ColorPickerWidget |
| 4 |
|
| 5 |
|
| 6 |
class ColorPickerField(CharField): |
| 7 |
|
| 8 |
def __init__(self, *args, **kwargs): |
| 9 |
kwargs["max_length"] = 7 |
| 10 |
super(ColorPickerField, self).__init__(*args, **kwargs) |
| 11 |
|
| 12 |
def formfield(self, **kwargs): |
| 13 |
kwargs.update({"widget": ColorPickerWidget}) |
| 14 |
return super(ColorPickerField, self).formfield(**kwargs) |
| 15 |
|
| 16 |
|
| 17 |
try: |
| 18 |
from south.modelsinspector import add_introspection_rules |
| 19 |
add_introspection_rules([], ["^paintstore\.fields\.ColorPickerField"]) |
| 20 |
except ImportError: |
| 21 |
pass |