Hi, you can separate your querysets in get_context_data method.
See:
https://docs.djangoproject.com/en/dev/ref/class-based-views/mixins-simple/#django.views.generic.base.ContextMixin.get_context_data


2013/7/22 Pepsodent Cola <pepsodentc...@gmail.com>

> Hi,
>
> Can I only have one "get_queryset" for each Viewpage?
> If I wanted to add another database list on the same Viewpage how would
> that code look like for my Django *views.py* file?
>
> Example:
> https://docs.djangoproject.com/en/1.5/intro/tutorial04/#amend-views
>
> from polls.models import Choice, Poll
>
> class IndexView(generic.ListView):
>     template_name = 'polls/index.html'
> *    context_object_name = 'latest_poll_list'*
>
> *    def get_queryset(self):*
>         """Return the last five published polls."""
>         return Poll.objects.order_by('-pub_date')[:5]
>
>
>
> I mean will "context_object_name" be able to separate between several
> "get_queryset(self)"?
> Because I want to have several different poll_lists on the same Viewpage.
>
> context_object_name = 'latest_poll_list'
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Att. *Mário Araújo Chaves Neto*
*Programmer, Designer and U.I. Engineer*
*
*
*MBA in Design Digital* - 2008 - FIC
*Analysis and Systems Development* - 2011 - Estácio
*D**esign and Implementation of Internet Environments* - 2003 - FIC

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to