For the following model:
#models.py
class entry(models.Model):
title = models.CharField(max_length=25)
image = models.ImageField(upload_to="/",blank=True)
video_url = models.CharField(max_length=150,blank=True)
I want the model and corresponding ModelForm only be allowed either an image field or a video_url field, but not both.
How is this best accomplished? Do I need to validate on the model, the modelform, or both?
in your form you can use: