Repeated 'date__lte=dt.now()' move to manager?

4 views
Skip to first unread message

Ben Jackson

unread,
Dec 2, 2009, 12:02:39 AM12/2/09
to byteflow...@googlegroups.com
I see a lot of:

queryset = Post.objects.filter(date__lte=dt.now())

Shouldn't that just be part of PublicPostManager? Both seem to have
the same purpose.

In fact, my recent change to hide is_draft should probably have used
user.is_staff to select between Post.all_objects and Post.objects so
that all 'publicness' was in PublicPostManager.

--
Ben Jackson AD7GD
<b...@ben.com>
http://www.ben.com/

Alexander Solovyov

unread,
Dec 2, 2009, 4:29:18 AM12/2/09
to byteflow...@googlegroups.com
On 2009-12-02, Ben Jackson wrote:

> I see a lot of:

> queryset = Post.objects.filter(date__lte=dt.now())

> Shouldn't that just be part of PublicPostManager? Both seem to have
> the same purpose.

Good idea!

--
Alexander

Reply all
Reply to author
Forward
0 new messages