Re: Novice questions about Pagination syntax and classes in general

2019-06-01 Thread John Bagiliko
I will answer question two. I'm not sure I understand your question 1. The
"objects" is query method of every Django model. You use it to query.
Contacts should be in your models.py and you should import  Contacts in
your views.py before you can use it.

On Sun, Jun 2, 2019, 1:08 AM drone4four  wrote:

> 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:
>
>1.
>
>Is it possible to return more than one value when a function is
>assigned to a variable, like at line 3?
>2.
>
>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+unsubscr...@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.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC26BE3NXuvsfiOiyF_OAdUXB%3D2nX5S9xEb_OT-8_2v5Zx1cBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Novice questions about Pagination syntax and classes in general

2019-06-01 Thread drone4four


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:

   1. 
   
   Is it possible to return more than one value when a function is assigned 
   to a variable, like at line 3? 
   2. 
   
   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+unsubscr...@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.