I am relatively new to Django and am hoping somebody can help me. I
apologise in advance if this is a very simple question.
I have a model that has an expiry date. In my view I have the following:
queryset =
Post.objects.filter(expiry_date__gt=datetime.now()).order_by('expiry_date')
This works in my ListView.
I have been advised that I should put this in a custom model manager and
herein lies that the problem. I do not quite understanding how this would
work. I understand how to create a custom model manager but not the
realtionship with the view.
Could someone please explian this to me?
Many thanks.
--
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 [email protected].
To post to this group, send email to [email protected].
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/04528a48-e71d-4404-8621-eb650b514a8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.