Karen Tracey wrote: > On Sat, Jun 21, 2008 at 9:23 PM, M.Ganesh <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > > Hi All, > > This question might have been answered so may times, but I am > unable to > glean the information I am looking for from the 260 odd entries that > turn up while searching the mailing-list archives. So here I ask again > > #my models > class entity(models.Model): > name = models.Charfield(....) > > class address(models.Model): > entity = models.FK(entity) > #entites can > have multiple addresses > street_address = models.TextField(...) > > class despatch(models.Model): > sent_to = models.FK(entity, related_name = 'receiver') > address = models.FK(address) > sent_by = models.FK(entity, related_name = 'sender') > > Now when I show a form to enter 'despatch' data, after the user > selects > the sent_to 'sent_to' address, I want to show only the addresses > of that > entity in the 'address' selection. How do I do it? > > Note : I don't know java scripts, AJAX etc yet. If the above can be > achieved only using these, then a small code snippet will > help me > start > > > I have not had to do this myself, so have no code snippet to share. > It does seem like a commonly-discussed thing, but in a quick Google > search I didn't find anything that matched exactly. This page: > > http://remysharp.com/2007/01/20/auto-populating-select-boxes-using-jquery-ajax/ > > discusses doing exactly what you want with jQuery and Ajax...and PHP. > So not quite what you are looking for. But this page: > > http://www.packtpub.com/article/enhancing-the-user-interface-with-ajax > > discusses adding jQuery to a Django app and doing other cool stuff > with it. So probably you can glean bits of information from both and > put it together to do what you are looking for. I do believe you need > to learn a little Javascript/Ajax to do this. > > Karen Thanks Karen for the leads. I'll follow those breadcrumbs
Regards Ganesh --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

