Thanks guys, works great On Mar 24, 7:54 pm, akaariai <akaar...@gmail.com> wrote: > On Mar 24, 9:40 pm, Ryan Osborn <ryan.osbor...@gmail.com> wrote: > > > > > > > > > > > Hi, > > > I am using django 1.3 and have the following in my urls.py for a > > blogging application: > > > urlpatterns = patterns('', > > url(r'$', > > ArchiveIndexView.as_view(model=Entry,date_field='created',paginate_by=10), > > name='blog_archive_index'), > > url(r'today/$', > > TodayArchiveView.as_view(model=Entry,date_field='created',paginate_by=10), > > name='blog_archive_today'), > > url(r'(?P<year>\d{4})/$', > > YearArchiveView.as_view(model=Entry,date_field='created',paginate_by=10),name='blog_archive_year'), > > url(r'(?P<year>\d{4})/(?P<month>[a-z]{3})/$', > > MonthArchiveView.as_view(model=Entry,date_field='created',paginate_by=10),name='blog_archive_month'), > > url(r'(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\d{2})/$', > > DayArchiveView.as_view(model=Entry,date_field='created',paginate_by=10),name='blog_archive_day'), > > url(r'(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\d{2})/(? > > P<slug>[\w\-]+)/$', > > DateDetailView.as_view(model=Entry,date_field='created'),name='blog_entry_detail'), > > ) > > > I was just wondering if there was a simple way to condense this as > > with django 1.2 I could add all this in to a dictionary like: > > > info_dict = {'model': Entry, 'date_field': 'created', 'paginate_by': > > 10} > > > Ryan > > You can define the info_dict as above, and then use: > url(r'$', ArchiveIndexView.as_view(**info_dict), > name='blog_archive_index'), ... > > - Anssi
-- 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.