Tuesday, October 17, 2017

Tutorial part 4 - get_queryset()


Hi,

I'm new and going through the tutorial and I'm having trouble understanding how the get_queryset() function in the IndexView is called, is this just an automatic part of using generic views?

I had a look elsewhere in the documentation, primarily at generic views, and other examples seem to include either just creating a model attribute or directly assigning a queryset attribute as well as defining a get_queryset function.

Aside of not being clear on how the get_queryset() function is called, I'm now wondering what benefit the function has over just doing a 'queryset =' assignment.

Some help in understanding how this fits together would be most appreciated.  My project works just fine, I just don't quite understand how it works.

Regards,

  Tony


--
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/261aa03d-4d17-4102-b3df-6f4eab6e3b51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment