m2m relationship management

3 views
Skip to first unread message

Justinas Jaronis

unread,
Oct 14, 2010, 5:45:02 AM10/14/10
to Django users
I'm currently developing quite complex database on Django. It seems to
be perfect for auto administrative interface etc, However because of
the complexity (just the models.py classes are about 2000 lines; There
are some objects that will have about 20+ m2m relationships) it's
completely unusable to administer such a database using current
inline implementation. I've found some information how to solve the
usability issue, by collapsing the body of all inlines:

http://stackoverflow.com/questions/2788143/django-admin-how-to-make-inlines-collapsible

however IMO it's too heavy to render everything on every page load. I
think the best solution would be to develop the administration view,
containing buttons (like "Many2many relationship 1", "m2m relationship
2" etc) that would dynamically load the inline via AJAX/AHAH upon the
button click.

Maybe someone has already faced this problem? I can't believe I'm the
only one :-)

Good luck,
Justinas

Javier Guerra Giraldez

unread,
Oct 14, 2010, 10:39:15 AM10/14/10
to django...@googlegroups.com
On Thu, Oct 14, 2010 at 4:45 AM, Justinas Jaronis
<justinas...@gmail.com> wrote:
> There
> are some objects that will have about 20+ m2m relationships

not knowing anything about your system, it might be the best solution;
but in the _vast_ majority of cases this is a signal of suboptimal
design. maybe there's some commonality that could be abstracted with
table inheritance, or generic relationships.

--
Javier

Justinas Jaronis

unread,
Oct 14, 2010, 11:26:49 AM10/14/10
to Django users
In the first place, I have no access to the database design - the
django application will be like frontend to already deployed database
with loads of information.
Furthermore I don't blame the architect for the design, because it's
just impossible to store the required information somehow else - it's
really complex scientific database. I see some perspective for
generalization, but this is out of scope of this problem and project
phase :-)

On 14 Spa, 17:39, Javier Guerra Giraldez <jav...@guerrag.com> wrote:
> On Thu, Oct 14, 2010 at 4:45 AM, Justinas Jaronis
>
Reply all
Reply to author
Forward
0 new messages