Django admin widget override -
i've write class, 'mywidget', extend foreignkeyrawidwidget , override render method. (https://github.com/django/django/blob/master/django/contrib/admin/widgets.py line:130)
now use mywidget instead of foreignkeyrawidwidget fields in admin site.
currently i've tried create modelform lines
class meta: model = mymodel widgets = { myfield : mywidget }
and 1 so
myfield = mywidget() class meta: model = mymodel
but none works me, 2 errors:
[first form configuration]
exception value:
error when calling metaclass bases init() takes @ least 3 arguments (1 given)
exception location: /home/martin/envs/dmbcau/local/lib/python2.7/site-packages/django/forms/fields.py in init, line 90
[second form configuration]
exception value:
init() takes @ least 3 arguments (1 given) exception location: /home/martin/projects/dmbcau/storage/admin.py in mywidget, line 244
knows should make working?
widget source @catherine
mywidget = foreignkeylinkedrawidwidget
http://pastebin.com/1qug1vsz
Comments
Post a Comment