python - Django Class Based View Inheritance Issue -


i have 2 form classes, each of modelform of same model. 1 called projectform , other called adminprojectform. projectform has number of fields excluded, adminprojectform not.

in views, i'm using 2 classes, edit , adminedit. edit uses django generic editing view of updateview , has form_class set projectform. adminedit inherits edit , has form_class set adminprojectedit.

one think mean form generated adminedit show fields excluded on edit. part working correctly - form fields drawn fine (and not drawn on edit. however, when submitting adminedit form, field excluded in projectform stripped , not saved. suggestions?

here's forms.py:

class projectform(modelform):     class meta:         model = project         exclude = ('field1', 'field2', 'field3',     'qualifies_for_judging', 'reason_for_disqualification', 'finalist', 'hashtag')  class adminprojectform(modelform):     class meta:         model = project         exclude = () 

and views.py:

class edit(updateview):     model = project      form_class = projectform  class adminedit(edit):     model = project      form_class = adminprojectform 


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -