google-code-export / django-grappelli

Automatically exported from code.google.com/p/django-grappelli
0 stars 0 forks source link

New Feature - Admin Order #102

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Ok, this ties into the new Admin index page as well.  One thing that
bothers me is that the subsections of an app are always alphabetically
sorted.. which can create an illogical order of options.

For example:

Just say I have an app called "reviews".  In this app I have various models..

Reviews
 Category Settings     + Add  - Change
 Niche Settings        + Add  - Change
 Site Reviews          + Add  - Change
 Sites                 + Add  - Change
 Site Settings         + Add  - Change

But I don't want it ordered like that.. (seems messy).. rather I'd prefer.

Reviews
 Sites                 + Add  - Change
 Site Reviews          + Add  - Change
 Site Settings         + Add  - Change
 Category Settings     + Add  - Change
 Niche Settings        + Add  - Change

Seems cleaner and more logical right?  Well would it be possible to
implement an 'order' parameter in the Admin of these models?

example:

class SiteOptions(admin.ModelAdmin):

  ...

  class Media:
    order = 0

I don't know if the "Media" class is the most logical choice for the
"order" parameter (does ModelAdmin have a Meta class?) but I'll leave the
implementation upto you.. I was just curious as to whether this is doable?
 Personally I believe it will enhance the "Editor's" work environment, with
logical lists of options presented to them.

Cheers,
  Gontro.

Original issue reported on code.google.com by Gontro@gmail.com on 24 Sep 2009 at 6:20

GoogleCodeExporter commented 9 years ago
I´ve been thinking about that and it´d be a nice feature. problem is, that 
although
ModelAdmin is the best place to do that, it´s hard to reorder apps ... you 
have to
open different files and change the order. it´s nicer if this is part of the
admin_apps definition.

I haven´t found a way to implement that, but I´ll check that again.

Original comment by sehmaschine on 24 Sep 2009 at 7:20

GoogleCodeExporter commented 9 years ago
fixed with rev533. you can now use an attribute order within your ModelAdmin. 
see
admin.py for an example of how to use this.

Original comment by sehmaschine on 3 Oct 2009 at 2:12

GoogleCodeExporter commented 9 years ago
seems to be broken currently?

Original comment by zackdy...@gmail.com on 13 Feb 2010 at 2:53