Ticket #7: filter.diff

File filter.diff, 798 bytes (added by Manuzhai, 19 years ago)

Get the correct fieldname for the current filter.

  • django/views/admin/main.py

     
    233233            elif isinstance(f, meta.DateField):
    234234                today = datetime.date.today()
    235235                one_week_ago = today - datetime.timedelta(days=7)
    236                 field_generic = '%s__' % field_name
     236                field_generic = '%s__' % f.name
    237237                filter_template.append('<h3>By %s:</h3><ul>\n' % f.verbose_name)
    238238                date_params = dict([(k, v) for k, v in params.items() if k.startswith(field_generic)])
    239239                today_str = isinstance(f, meta.DateTimeField) and today.strftime('%Y-%m-%d 23:59:59') or today.strftime('%Y-%m-%d')
Back to Top