I'm trying to figure out a view for a "featured Foo for <month>". The
thinking is we'll mark the thing we want featured and which month it
should appear.

So, in the model, I'm thinking featured_for_month with month_choices
being the months and featured for year being something like:
YEAR_CHOICES  = [(str(y), str(y)) for y in range(datetime.date.today
().year, datetime.date.today().year+1)]

then in the view,
have something like
Foo.objects.get(featured_for_year=datetime.date.today().year,
featured_for_month=datetime.date.today().month)

Sound reasonable? Is there a better way to do this?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to