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 <[email protected]>:
> 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 [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.

-- 
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.

Reply via email to