Ticket #779: extra_lookup_kwargs_callable_r1217.patch

File extra_lookup_kwargs_callable_r1217.patch, 580 bytes (added by Tom Tobin <korpios@…>, 19 years ago)

Patch against r1217 to implement callables for extra_lookup_kwargs

  • views/generic/list_detail.py

     
    3737    """
    3838    mod = models.get_module(app_label, module_name)
    3939    lookup_kwargs = extra_lookup_kwargs.copy()
     40    for key, value in lookup_kwargs.items():
     41        if callable(value):
     42            lookup_kwargs[key] = value()
    4043    if paginate_by:
    4144        paginator = ObjectPaginator(mod, lookup_kwargs, paginate_by)
    4245        page = request.GET.get('page', 0)
Back to Top