I have 2 simple form/model classes
class Booking(forms.Form):
name = models.CharField(max_length=100, verbose_name="Your name*:")
place = models.ManyToManyField(Location, blank=True, null=True)
class Location(models.Model):
place = models.CharField(max_length=100)
When I display the form I only want to show locations not already previously picked. The tricky bit (I think) is having the location as ManytoManyField
as I can't add unique=True
to it.
So for example user x will pick from a list (London, Cardiff or Edinburgh) and select London. When user y loads the form London will no longer be available to select.
Any ideas?