well override ModelForm's __init__ and if theres a kwargs , then populate
choices depending upon the value of model_name , as well override def
clean() to handle model attribute.
class ConditionSetAdminForm(forms.ModelForm):
def __init__(self,*args,**kwargs):
hey all
I have a model which is as such:
*in models.py*
class ConditionSet(models.Model):
model_name =models.CharField(max_length=
50)
model_attribute =models.CharField(max_length=50)
operator =models.CharField(max_length=50,
choices=OPERATORS)
val
2 matches
Mail list logo