I need to limit choices dynamically by an object, not a class:
class CertType(models.Model):
name = models.CharField(max_length=128)
class ActivityTopic(models.Model):
cert_types = models.ManyToMany(CertType)
class Participation(models.Model):
activity_topic = models.ForeignKey(activity_topic)
cert_type = models.ForeignKey(CertType)
An activity topic can deliver one or more cert types, but a
participation has a single cert type. When adding or changing a
participation object, either in the admin or via model forms, I need
to limit the choices for cert type to those offered by the the
participation's activity topic.
limit_choices_to seems like the obvious answer, but, as it is defined
at the class level, I can't seem to figure out how to get the specific
object into the limit.
Perhaps I am going totally in the wrong direction, or this is
something I can't do other than custom view to add the participation
records.
Any thoughts? Thanks,
Wayne
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---