Admin coding guidelines order?

17 views
Skip to first unread message

Micky Hulse

unread,
Sep 17, 2011, 7:10:15 PM9/17/11
to django...@googlegroups.com
Hello,

I follow the rules on this page for my models (and other files/code):

<https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/>

But are what about the admin.py file?

Sometimes my admin classes can get pretty cluttery (form,
display_on_top, prepopulated_fields, filter_horizontal, fieldsets,
methods, other).

Do any of ya'll have any tips on keeping the admin classes organized
and readable?

Thanks!
Micky

Micky Hulse

unread,
Sep 17, 2011, 10:14:53 PM9/17/11
to django...@googlegroups.com
On Sat, Sep 17, 2011 at 4:10 PM, Micky Hulse <rgm...@gmail.com> wrote:
> But are what about the admin.py file?

How's this for organization(?):

<https://gist.github.com/1224591>

I guess I am curious how other folks would go about organizing things. :)

Thanks!
Micky

Micky Hulse

unread,
Sep 17, 2011, 10:43:15 PM9/17/11
to django...@googlegroups.com
On Sat, Sep 17, 2011 at 7:14 PM, Micky Hulse <rgm...@gmail.com> wrote:
> How's this for organization(?):

Bare bones example:

<https://gist.github.com/1224591#file_admin_template.py>

Note on comments:

Trying to follow similar guidelines for comments as found here:

<http://tinyurl.com/9qc29u>

I have always liked that style of "Section separators".

Reply all
Reply to author
Forward
0 new messages