On 08/05/2009 03:36 PM, sveri wrote:
> Hi,
>
> i wonder if it is possible to change the admin interface of an app
> like that:
>    
Yes, it is very possible.

> Now i go to the admin interface of Entries and want to add a new
> Entry.
> Then i select a party for the new entry.
> After having that selected i want to reload the form ajax like
> and show only the politicians that belong to that specific selected
> party.
>    
One way to do this would be to override the admin template for the 
change_form.html for your model, and add the necessary Javascript to it 
to do what you need.  You will likely need to create a view for your app 
that performs the querying for your Ajax request, but you'd write the 
view like you would any other, and you'd just override the admin 
template to include the Javascript that calls to your view and parses 
the response.

Overriding the admin templates documentation is here:

http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates

Hope that helps,

---Peter

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