So I have a class, specifically, this:
class ProductVariantForm_PRE(ModelForm):
class Meta:
model = ProductVariant
exclude = ("productowner","status")
def clean_meta(self):
if len(self.cleaned_data['meta']) == 0:
raise forms.ValidationError(_(u'You have to select at least 1 meta attribute.'))
for m in self.cleaned_data['meta']:
for n in self.cleaned_data['meta']:
if m != n:
if m.name == n.name:
raise forms.ValidationError(_(u'You can only select 1 meta data of each type. IE: You cannot select 2 COLOR DATA (Red and Blue). You can however select 2 different data such as Shape and Size.'))
return self.cleaned_data['meta']
I wish to extend this class (a ModelForm), and so I have a class B.
Class B will look like this:
class B(ProductVariantForm_PRE):
How can I access the inner class "Meta" in class B and modify the exclude field?
Thanks!