3 ms·
Django ModelForms[1] do seem (to my rails-ignorant self) to be quite similar to what's being described here. class SomeForm(ModelForm): class Meta:
by shabble 14y ago
Django ModelForms[1] do seem (to my rails-ignorant self) to be quite similar to what's being described here.
class SomeForm(ModelForm):
class Meta:
model = SomeModel
fields = [ whitelist ]
exclude = [ blacklist ]
Both fields and exclude are optional, if neither are specified 'all'[2] fields for the model will be included in the form.
[1] https://docs.djangoproject.com/en/1.4/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form https://docs.djangoproject.com/en/1.4/topics/forms/modelform...
[2] The model can blacklist certain fields with editable=False in the field definition as well, which afaik trumps anything a ModelForm does.