As part of the official Django doc on Pagination, take a look at the listing function:
def listing(request):
contact_list = Contacts.objects.all()
paginator = Paginator(contact_list, 25) # Show 25 contacts per page
My two questions are:
Is it possible to return more than one value when a function is assigned to a variable, like at line 3?
At line 2, is `objects` a method within the Contacts class? If so, where is the Contacts class defined? It's not imported at the top of the example views.py also in that Django doc above where I got this code sample.
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3540a14b-ef8a-4de3-ad59-858ca1c2a7c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment