Is there any way to create an object in a model using a ManyToManyField?
Here are the models:
class Booking(models.Model):
tour_ref = models.CharField(max_length=30)
customers = models.ManyToManyField(Customer)
class Customer(models.Model):
name = models.CharField(max_length=40)
email = models.EmailField()
The task is to create a new Booking object. But how do I do this using specific customers from the Customer table? (I would be identifying them by email). (Obviously more than one customer would be likely).
Many thanks!