Re: passing multiple query sets into a url pattern

2012-02-19 Thread Stanwin Siow
Cheers bill! Figured it out already. However i'm stuck on the database problem which i wrote in a separate email. Stan Best Regards, Stanwin Siow On Feb 19, 2012, at 9:34 PM, Bill Freeman wrote: > Yes, you can, as part of the extra context, by whatever name doesn't > collide. Then you > co

Re: passing multiple query sets into a url pattern

2012-02-19 Thread Bill Freeman
Yes, you can, as part of the extra context, by whatever name doesn't collide. Then you could use it in your template, in a "for" tag. You could also pass another one, by a name other than "queryset" at the same level as the first one, but that becomes an argument to the view, so don't expect it t

Re: passing multiple query sets into a url pattern

2012-02-19 Thread Alfredo Alessandrini
Hi Stanwn, try this: def get_keyword(): return Keyword.objects.all() UserProfile_info = { "queryset" : UserProfile.objects.all(), "extra_context" : {"keyword_list" : get_keyword } } Now you can use the variable {{ keyword_list }} to populate the template. Alfredo 2012/2/19 Stan

Re: passing multiple query sets into a url pattern

2012-02-18 Thread Alfredo Alessandrini
Hi, I'm not sure that I've understand your question: url(r'^profile/(?P\d+)/(?P\d+)$', ..) and now you can use the variable var_1 and var_2 in your function. Alfredo 2012/2/18 Stanwin Siow > Hello, > > I want to find out if there is anyway to pass two querysets into a url > pattern. >

passing multiple query sets into a url pattern

2012-02-17 Thread Stanwin Siow
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.objec