Hi All,

I'm trying to preset a dropdown list in a template. On a customer detail page I 
have a link to add a project. I got as far that the customer_id is already in 
the project_add method. What do I pass on to the template so that the dropdown 
list (with customers) has the customer with the related id already selected?

The clarifying snippets:

Link in the customer page: <a href="/myapp/project/add/{{ customer.id }}">New 
Project</a>

The url: (r'^project/add/(?P<customer_id>\d+)$', 'project_add')

The view:

def project_add(request, customer_id):
    print customer_id   # <<< this contains the id
    form = ProjectForm()
    return render_to_response(template+'/project_add.html', {'form': form})

Thanx a lot!

Regards,

Gerard.

-- 
urls = { 'fun':  'www.zonderbroodje.nl',  'tech':  'www.gp-net.nl' }


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