我有一個ModelForm: class SomeModelForm(forms.ModelForm):
class Meta:
model = SomeModel
def __init__(self, *args, **kwargs):
super(ApiBackendConfigForm, self).__init__(*args, **kwarg
假設我有以下幾點: models.py: VALUE_CHOICES = (('0', 'ZERO'),
('1', 'ONE'))
class ModelA(models.Model):
def val(self):
return self.model_b.value or ''
class ModelB(models.Model):
mo