Hello,

First question:

I want to use a generic view with an url that had a parameter. This
parameter should filter my queryset.
How does this work? I don't now what to write in the filter-option?
---------------------
e = {
    'template': 'foo.html',
    'extra_context': {'list': Event.objects.filter(date__year=????)}
}

urlpatterns = patterns('django.views.generic.simple',
     url(r'^events/(?P<year>\d{4})/$', 'direct_to_template', e),
)
---------------------

Second question:

The url "example.com/app/events/" should be redirect to "
example.com/app/events/2007/".
But 2007 shouldn't be hard-coded. 2007 should be the result from a
object-filtering. Is this possible
with a generic view:
---------------------
urlpatterns = patterns('django.views.generic.simple',
     url(r'^events/$', 'redirect_to', {'url': ???? }),
)
---------------------

Regards
  Bernd

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to