List Info

Thread: Make archive_* generic views less archival




Make archive_* generic views less archival
user name
2006-03-31 17:28:18
This is an entirely selfish post, but since date_based
generic views
now have the 'allow_empty' parameter, they've effectively
become a
convenient means of displaying any year/month/day date-based
objects.
Could another param be added to simply switch the check that
ensures
the object is lte now?

if last_day >= now.date():
	lookup_kwargs['%s__lte' % date_field] = now

it's present in all date_based generic views and it's
getting in my way
;)
I figure a non-intrusive and revised generic view could look
like:

def archive_month(request, year, month, app_label,
module_name,
date_field, ..., archival=True):
    ...
    if last_day >= now.date() and archival:
        lookup_kwargs['%s__lte' % date_field] = now

Does the rest of the community have any application for
non-archival
date-based generic views?
I only bring it up because my event model suits this setup
perfectly
(completely selfish).
I'll submit a patch if this is generally a good thing.


Luke Skibinski Holt


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )