i'm looking for advice on how to make the admin add_view better for
the Registration model.  The 'sessions' m2m and 'fee' fk should be
filtered based on the 'event' fk (both Session and RegistrationFee
have an 'event' fk as well).  Of course, the filtering can't happen
until the admin user chooses an event.

i was envisioning an admin experience where the add_view has a first
page that only asks for the event, and uses that event to filter on
the next page.  (this is similar to the "add new user" view of
contrib.admin, with the notable exception that the first view actually
saves the object, whereas here, i can't)  i have a working model where
if i send ?event=123 in the url, the add_view will filter 'sessions'
and 'fees' correctly.  But i don't know how to get the first view,
with only the 'event' field, to post the selected event pk to the url.

Any suggestions?  Here's a stripped down models.py for reference:

-----------------------

class Event(models.Model):
    title = models.CharField(max_length=250)

class Registration(models.Model):
    event = models.ForeignKey(Event)
    registrant = models.ForeignKey(Contact)
    sessions = models.ManyToManyField(Session, blank=True)
    fee = models.ForeignKey('RegistrationFee')

class Session(models.Model):
    title = models.CharField(max_length=250)
    event = models.ForeignKey(Event)

class RegistrationFee(models.Model):
    name = models.CharField(max_length=250)
    value = models.DecimalField(default=0, decimal_places=2)
    event = models.ForeignKey(Event)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to