Django Admin Form Validation from QuerySet
I have these two models:


	class Service(MelosModel):
		performer = models.ForeignKey(Performer)
		event = models.ForeignKey('Event')
		composition = models.ForeignKey(Composition)


	class Event(MelosModel):
		event_type = models.ForeignKey('EventType')
		project = models.ForeignKey(Project)
		works = models.ManyToManyField(Work)
		date_of_event = models.DateTimeField()
		location = models.ForeignKey(Address)

_Note: A `MelosModel` is for all intents and purposes the same as `models.Model`. Also, `Composition` extends `Work`._

The trouble is that the list of compositions in the `Service` admin form needs to be validated against the available `Work`s from its `Event.` How do you do this?

I read about making a `ModelChoiceField` from a queryset but that wouldn't help because we don't know what the `Event` is until the form is submitted. What is the best way to deal with this?
Django Admin Form Validation from QuerySet
===

I have these two models:


	class Service(MelosModel):
		performer = models.ForeignKey(Performer)
		event = models.ForeignKey('Event')
		composition = models.ForeignKey(Composition)


	class Event(MelosModel):
		event_type = models.ForeignKey('EventType')
		project = models.ForeignKey(Project)
		works = models.ManyToManyField(Work)
		date_of_event = models.DateTimeField()
		location = models.ForeignKey(Address)

_Note: A `MelosModel` is for all intents and purposes the same as `models.Model`. Also, `Composition` extends `Work`._

The trouble is that the list of compositions in the `Service` admin form needs to be validated against the available `Work`s from its `Event.` How do you do this?

I read about making a `ModelChoiceField` from a queryset but that wouldn't help because we don't know what the `Event` is until the form is submitted. What is the best way to deal with this?