﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
450	Dynamic lookup keywords for generics	slashzero	Adrian Holovaty	"I have a database with weather data with daily updates for each weather station in the area.  My first thought was to use the date base generic views.  I wanted to be able to specify the station_id in the url so that the url is something like /weather/KAPF/2005 , but the generic view will only allow you to specify extra lookup keywords in the url pattern module, not dynamically in the url.

What I created was an extra argument called: 'dynamic_lookup_kwargs'

Simply use that the same way as the extra_lookup_kwargs except that you use the url keyword name instead of a hard coded value.

So for the pattern:
(r'^(?P<station_id>\w{4})/(?P<year>\d{4})/$','archive_year',  info_dict),

We would define the dynamic_lookup_kwargs as:
info_dict = {
  ...  
  'dynamic_lookup_kwargs' : {
      'station_id__exact' : 'station_id'
     }
  ...
}"	enhancement	new	Admin interface		normal				Unreviewed	1	0	0	0	0	0
