On Dec 14, 6:54 am, Mathilde V <m.vie...@nordnet.fr> wrote: > Hi, > > I'm a newbie with Django and I need some advice about legacy > database. > I've got a PostgreSQL database (8.4) with several schemas, > each containing a lot of tables. And I wish to transfer the actual > associates site into Django, but it would take to much time to > re-organise all the database. > > But, by using python mananage.py > inspectdb, I became aware that it runs well only for the public schema. > After some researchs, I found some patches > athttps://code.djangoproject.com/ticket/6148[1] and some app > athttps://github.com/tuttle/django-schemata[2] . > > The question is: What > do you thing is the best to use? > > Because the ticket is 3 years old, > and I'm wondering if things have been added by the time in the core? > In > the description of the app, we can read this : "One schema for one > customer" but I have several schema for one customer, and i'll need to > read and add information in all of them.
If you are asking what is the best way to deal with multi-schema databases, I am afraid the right place to discuss that is django- users. However, if you are asking about the ticket's patch status, I am under the impression the latest patch to that ticket is somewhat dangerous. It sometimes works, sometimes doesn't and can for example destroy your main database when it tries to destroy your test database (or that is what one comment says, no personal experience). I would advice that your best bet is using search_path (ALTER USER or SET LOCAL, see PostgreSQL documentation), you might be lucky enough to just add all your schemas into the search path and be done with it. As said, further discussion of how to use multiple schemas belongs to django-users. If you are interested discussing implementing multi- schema in Django itself, then this is the right forum. And as for implementing that, generating the correct queries is the easy part. Inspectdb, syncdb etc is the hard part. - Anssi -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.