On Apr 30, 6:11 am, Rex <rex.eastbou...@gmail.com> wrote:
> Let's say I've got two models: User, and Country. Each user is from
> one country, and each country has multiple users. so the User model
> contains a ForeignKey for a Country object.
>
> Can I do either of the following through the Django admin web
> interface?
>
> (1) When I'm looking at the list of Users, have the "country" column
> contain a hyperlink that takes me to that particular Country object.

Not automatically, but you can define a method that returns HTML
containing the link for each country, and use that in the changelist
for Users. See list_display on this page:
http://docs.djangoproject.com/en/dev/ref/contrib/admin/

> (2) When I'm looking at a Country object, show the set of all users
> that have a ForeignKey to this Country, along with a hyperlink to
> those User objects.

You can use inline editing of foreign key items, which is far more
powerful. See
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#inlinemodeladmin-objects

> Any tips would be appreciated.
>
> Thanks,
>
> Rex
--
DR.
--~--~---------~--~----~------------~-------~--~----~
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