Skip to content

added reverse order for admin_order_field #2201

Closed
wants to merge 1 commit into from

2 participants

@fetzig
fetzig commented Jan 23, 2014

after adding this you can setup something like this:

def age_in_years(self):
    return # age calculated via DateField self.date_of_birth
age_in_years.admin_order_field = '-date_of_birth'

the '-' at the beginning of '-date_of_birth' indicates the reverse order in the changelist.

@fetzig fetzig added reverse order for admin_order_field
after adding this you can setup something like this:

```
def age_in_years(self):
    return # age calculated via DateField self.date_of_birth
age_in_years.admin_order_field = '-date_of_birth'
```

the '-' at the beginning of '-date_of_birth' indicates the reverse order in the changelist.
2924431
@timgraham
Django member

This seems like a reasonable feature, but it needs a Trac ticket, documentation, and tests in order to be merged.

@fetzig
fetzig commented Feb 1, 2014

thx very much for your feedback @timgraham. wouldn't take the time to turn this into a proper ticket if nobody likes it :)

so i made this:
https://code.djangoproject.com/ticket/21924
(filled out to the best of my knowelege...)

will work on it as soon as i have time.

@fetzig fetzig closed this Feb 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.