Interrelated form fields
Hi all
I have a question to make
I'm tryng to build a form using the following models:
---
in models.py
class Client(models.Model):
user = models.ForeignKey(User, verbose_name=u'associated user')
telephone = models.CharField(u'Telephone number', max_length=33,
blank=False, null=False)
class Appointment(models.Model):
client= models.ForeignKey(Client, verbose_name=u'associated
client')
date = models.DateField('Booked to', blank=False, null=False)
---
As you see, the Appointment model depends on the Client one
So, I want a form showing at first the client's select box according
to the DB records of model Client
As soon as one client is selected, I want the form to show only the
appointments booked to him
How can I make that happen?
Thanks!
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home