On Fri, Nov 26, 2010 at 4:33 PM, Sebastien Ramage
<[email protected]> wrote:
>
>
>> First off, this is a stupid database design. Do you really create new
>> tables in your DB each time you add a user? Mental.
>
> yes you're right and what I said was just a example ;)
> In the real app, there's no per user table but per company
> the database is used by many different companies and each company have
> a code (100,200,...) and this code is used in tablename.
> And I can't change this design because this is the design use by Baan
> ERP (call ERP LN now)
>
>
>> You can make this work though. You can execute code in your models.py
>> to dynamically generate all your models, as described on the wiki page
>> you already mentioned.
>
> hum, I've not see this part,
> if I understand, you suggest that I have to generate all models
> dynamically at models.py import ?
>
> Seb
>

Yep, I thought this may be some sort of multi tenant application.
There is some work being planned for multi tenancy for 1.4 (iirc, see
the thread on django-developers).

Generating all the models at import time is doable - see the example
on the wiki page where the author generates arbitrary models that are
described in the database - but you would still have to find a way to
make your views generic, or choose model types according to tenant.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users?hl=en.

Reply via email to