Friday, February 17, 2012

passing multiple query sets into a url pattern

Hello, 

I want to find out if there is anyway to pass two querysets into a url pattern.

i have this url pattern at the moment.

UserProfile_info = {
    "queryset" : UserProfile.objects.all(),
    "extra_context" : {"keyword_list" : Keyword.objects.all}
}

    url(r'^profile/$', list_detail.object_list, UserProfile_info),


I understand from http://www.djangobook.com/en/1.0/chapter09/ that the extra_context field is to defind another query set.

in my Userprofile.html i have the following code:

{% for userprofile in object_list %}
   {% if userprofile.username = user.username %}

that will give me the list of items in userprofile table in the database.

Is there a way to include the list of items from the keyword table as well?
    









Best Regards,

Stanwin Siow



0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate