i' ve the following django model:
class OrderLog(models.Model):
order = models.ForeignKey(Order)
entry = models.TextField()
private = models.BooleanField(default=False)
and the related form:
class OrderLogForm(forms.ModelForm):
class Meta:
model = OrderLog
fields = ('entry', 'order', 'private')
. How can i modify the fields parameter based on the request parameter? So, if the user is testuser, than the fields tuple contains only the first 2 elements, in other cases 3 elements. Can request be accessible somehow from the form itself?
Thanks.