How can I make mandatory fields non-mandatory when another [associated] field has a certain value?
Let’s assume I have the following models:
class foo(models.Model):
bar = models.CharField(max_length=200)
foo_date = models.DateTimeField()
When I save, and bar contains a certain value, i’d like foo_date to become non-mandatory. How do I accomplish that? Thanks.
T.Stone is right. This is how you do it with a Model Form:
http://docs.djangoproject.com/en/dev/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other