-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
El 20/11/13 12:54, Brad Smith escribi�:
> Based on other threads I've read here, it seems that the
> conventional wisdom is that the admin interface is only for
> low-level access to the database, and isn't designed for anything
> "fancy", like users with different levels of administrative rights
> within an app, etc. Ok, I get that, but if I may grasp at some
> straws briefly I'd like to ask one follow-up that I haven't seen
> answered elsewhere: my app has a bunch of objects with complicated
> relationships for which I've devised a reasonably pretty and
> intuitive editing interface using Django's admin and Grappelli.
> Since this took a nontrivial amount of effort, I wanted to ask here
> if there are any tricks I should know about for re-using *any*
> views, inlines, etc from that admin interface in a more integrated
> editing interface with granular access controls, or do I just need
> to suck it up and rewrite everything from scratch using regular
> Django forms?
The django admin code is very extensible and re-usable. The
documentation may not stress this enough, but it is possible to do
virtually anything you want with it.
If I'm understanding your "outside" of the admin concept correctly,
what you want to do is extend the AdminSite[0] class (or maybe not
even that, just create a new instance) and attach the ModelAdmins you
want to it. I think you can even use autodiscover with a custom
AdminSite instance too if you need to have all models from
settings.INSTALLED_APPS attached to it.
[0]
https://docs.djangoproject.com/en/1.6/ref/contrib/admin/#adminsite-objects
- --
Gonzalo Delgado
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (Darwin)
Comment: Using GnuPG with Thunderbird -
http://www.enigmail.net/
iF4EAREIAAYFAlKNOH4ACgkQzbfdFL5JoUlCVQD6A1TUqYfKbgBDITrpvFblkQfo
nrVMCxnxSPIiREHgJaMBAKTR2auknxE6sX5s62B0j8eiH+AJB1EG1+AxeXoVHlGX
=kthG
-----END PGP SIGNATURE-----