1. Matthew Schinckel
  2. django-jsonfield
  3. Issues
Issue #14 resolved

Custom widget

Przemyslaw Kaminski
created an issue

Widget should be customizable, here's the basic diff:

{{{

!diff

forms.py 2012-09-27 15:08:45.000000000 +0200 --- forms.py 2012-09-28 10:14:06.996963379 +0200 *** 5,11 ****

class JSONFormField(forms.CharField): def init(self, *args, kwargs): ! kwargs['widget'] = JSONWidget super(JSONFormField, self).__init__(*args, kwargs)

  def clean(self, value):

--- 5,12 ----

class JSONFormField(forms.CharField): def init(self, *args, kwargs): ! if not 'widget' in kwargs: ! kwargs['widget'] = JSONWidget super(JSONFormField, self).__init__(*args, kwargs)

  def clean(self, value):

}}}