python - How can i add extra attribute to the form in admin dynamically -
i using django admin site custom application no custom front end end views.
i doing in admin.py
in 1 model , want add together text field in change_form
won't persisted doing ajax request external site
but not able know how can add together field
i don't want create new form because automatically done admin site
is there way can add together field in code this
def get_form(self, request, obj=none, **kwargs): search = forms.charfield(label='search') add together search existing code // here homecoming super(personadmin, self).get_form(request, obj, **kwargs)
there 2 options.
extend/customize default changelist form mentioned in link customize changelist template , inject(dynamically add) field in jquery ready() event. python django
No comments:
Post a Comment