Can someone help me here?
My form looks like this:
class RecieveLineForm(forms.ModelForm):
purchaseorderline = forms.IntegerField(widget=forms.HiddenInput())
rl_quantity = forms.IntegerField(label='Quantity')
class Meta:
model = RecieveLine
Now, I need to set a default value for my purchaseorderline which is originally a ModelChoice, but I overridden it as IntegerField because I'm planning to hide it so that whenever I get its data, it will return an integer and not an Object. Anyway, I need to know how to override the default value of it. Must I use the __init__
? My problem there is that, I don't know how to override the default value after it's been set. Any suggestions?
z