Re: Where admin classes should be registered ?

2012-06-28 Thread Shane Shane Bichel
jjcjgxydhfxydzh On Wed, Jun 27, 2012 at 12:54 AM, Alireza Savand wrote: > Hi > Common way to create [model|admin] classes is implement and create them in > [models|admin].py file. > But as standard non-django way is to create a python package named admin > for

Re: Where admin classes should be registered ?

2012-06-28 Thread Alireza Savand
Yes, But when my models.py/admin.py reach to +2000 line then django standard way not gonna help. That's why i seperate the classes into files and pkgs. I'm wonder is there any performance issue on this approach, since each class is in separate file, when i import them i'm sure python should find

Re: Where admin classes should be registered ?

2012-06-27 Thread Daniel Roseman
On Wednesday, 27 June 2012 08:54:07 UTC+1, Alireza Savand wrote: > > Hi > Common way to create [model|admin] classes is implement and create them in > [models|admin].py file. > But as standard non-django way is to create a python package named admin > for AdminClass es and create a file for

Re: Where admin classes should be registered ?

2012-06-27 Thread Alireza Savand
As your approach, at admin/__init__.py i have to from myapp.admin.ouradmin import * That means import all of the classes inside that files. On Wed, Jun 27, 2012 at 2:54 PM, Matt Schinckel wrote: > I generally register admin models where I define them, and then just >

Re: Where admin classes should be registered ?

2012-06-27 Thread Matt Schinckel
I generally register admin models where I define them, and then just import that file in admin/__init__.py If you are getting multiple registration errors, it may be that your app appears twice in sys.path (perhaps as app, and project.app?). That's generally a Bad Thing(tm). Matt. -- You

Where admin classes should be registered ?

2012-06-27 Thread Alireza Savand
Hi Common way to create [model|admin] classes is implement and create them in [models|admin].py file. But as standard non-django way is to create a python package named admin for AdminClass es and create a file for each admin class. But i couldn't find any standard way to register those admin