Hi,

I have been playing with Django for about a week, and I am really
impressed. I love python, but had previously been using php for my web
apps (LAMP). This is a big step forward :)

I have been having a few problems though...

I would like to use the 'add another' popup functionality (that is
automatically given to widgets for foreign key fields in the admin
interface) in my main web interface. Does anyone know of an easy way to
do this? I am currently using ModelForms to create my forms.

After a bit of snooping, I found the javascript
(django/contrib/admin/media/js/admin/RelatedObjectLookups.js) and html
(django/contrib/admin/templates/widget/foreign.html) that does it, but I
am unsure of the best way of adapting it. Is there a flag or something
that I don't know about, that I can set from within my ModelForm
subclass definition to use it already (I don't necessarily want it on
all of the foreign key dropdowns, so a flag seems like an appropriate
way)?

If not, I think my way to do it should be something like this:

Define a new widget that has the appropriate html, then add this to
urlpatterns in my app's urls.py file: 

('^([^/]+)/([^/]+)/add/$', 'django.contrib.admin.views.main.add_stage')
- not sure if this will work!!

Or

Add a similar tuple pointing to a hacked version of add_stage in my
app's views file so I don't run into permissions problems.

Am I heading in the right direction or completely barking up the wrong
tree?

Cheers,
Emily

PS

This is the version of Django I am using:
>>> django.VERSION
(0, 97, 'pre')


ARM Ltd, 110 Fulbourn Road, 
Cambridge CB1 9NJ, UK
Tel: +44 (0) 1223 406 365 

-- 
IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium.  Thank you.



--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to