Hi Vitaliy,

I'm not a core developer myself, but I found your problem very
interesting. I looked at model
property code and couldn't find any clues about table prefix, so I
wrote a patch and opened a
ticket for your particular problem.

By the way, this is my first patch for Django, so I'm sure I've done
something terribly wrong,
so someone please take a look at it: http://code.djangoproject.com/ticket/15238


Best regards,
Dmitry Gladkov

On Feb 2, 4:19 pm, Vitaliy <[email protected]> wrote:
> I have a case where I have a lot of django sites(partially with the
> same code) must run in a single mysql database
>
> in order to avoid conflicts  in django.auth, content-types and other
> models tables for them must have unique prefix (since this data must
> be isolated for each site)
>
> Currently there is no way to set global(or per application) table
> prefix (and all tickets that asked for this closed as invalid)
>
> search in this groups gives nothing
> So my question - was global table prefix for tables  considered ?
>
> and what is the way of doing this without this option(setting) in
> framework ?
>
> The only way I currently see is : handle "class_prepared" signal and
> manually add prefix to table name :
>
> from django.db.models.signals import class_prepared
>
> def handle(sender, *args, **kwargs):
>     sender._meta.db_table = PREFIX + sender._meta.db_table
>
> class_prepared.connect(handle)
>
> BUT documentation says that class_prepard for internal only and
> framework users should not use it?
>
> is there any other option ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to