mirror of
https://github.com/django/django.git
synced 2025-11-01 12:25:37 +00:00
Fixed #12875 -- Added get_ordering to ModelAdmin. Many thanks to Manuel Saelices.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16383 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
f0adae4c6e
commit
f749bb829c
6 changed files with 69 additions and 12 deletions
|
|
@ -24,3 +24,11 @@ class SongInlineDefaultOrdering(admin.StackedInline):
|
|||
class SongInlineNewOrdering(admin.StackedInline):
|
||||
model = Song
|
||||
ordering = ('duration', )
|
||||
|
||||
class DynOrderingBandAdmin(admin.ModelAdmin):
|
||||
|
||||
def get_ordering(self, request):
|
||||
if request.user.is_superuser:
|
||||
return ['rank']
|
||||
else:
|
||||
return ['name']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue