Thanks, but that bit of docs shows that there can be a relationship between models, but doesn't answer the question I was trying to ask which is, how to create the relationship in data.
On Thu, Nov 22, 2012 at 12:31 AM, Sergiy Khohlov <skhoh...@gmail.com> wrote: > > https://docs.djangoproject.com/en/dev/topics/class-based-views/generic-display/ > switch Publisher to client and books to address > :-) > > 2012/11/22 Lee Hinde <leehi...@gmail.com>: > > I have two tables, Client and Address. Address has a foreign key 'client' > > which points to the client table. I'll make my user enter a client and > then > > enter 1-x Addresses. I'll know which client the address is being linked > to > > before the record is created, with a url like : /client/3/address/new/. > > > > I want to seed the client id programmatically without presenting a form > > field to enter what's a known value. > > > > I've got this working with method based views, (just throw the client id > in > > a hidden field. easy peasy) but can't find an example for what seems to > me > > to be a real common need using class based views. > > > > The closest I've found are examples relating a user to an object, but > this > > isn't quite that and I've spent a fair amount of time trying to adapt the > > example and either the form complains because the client field is > missing or > > there's some other problem. > > > > Sooo, I'm hoping that there's an existing example/blog post/stackoverflow > > question that I've missed that someone could point me to that > demonstrates > > this process. > > > > Thanks and happy thanksgiving for us US residents. I'll be thankful for > the > > non-US folk who might be working and would care to take a shot at this. > > > > -- > > 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. > > -- > 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. > > -- 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.