I have been scouring the group and interwebs and it seems multi-tenant
comes up quite frequently in various scenarios, and mine is probably a
common one.  However, I haven't been able to distill a Djangooey best-
practice from what i've read, so I figure it won't hurt to bring it up
again.

Here is my situation:

1 site, 1 DB, multiple organizations, each with multiple users, 1
login page and set of client pages.  Not concerned about admin
implementation too much, since we are keeping that to system admins
(us) only.  Also, seems like the Sites framework won't be much help in
my scenario, unless i'm misunderstanding it.

So far, I have created a Organization model, with (automatic) id,
name, slug, and timezone fields,  and a "BaseOrganizationalModel"
Abstract model with a foreign key to an Organization, which i can
extend in any models that need to pertain to an organization.   Seemed
like the way to get started; correct me if I'm wrong. :)

The part I'm getting hung up on is how to manage this in the views and
to associate a user, and each request, with an organization, so that,
in a simple example, if i am in a view that returns a context
containing a list of objects of a model that extends
BaseOrganizationalModel, that I get only the objects that pertain to
the organization of the logged-in user.

Should I write a decorator? Some Middleware? A custom Manager?   (none
of which i've done before, but I'm happy to jump in)

A push in the right direction would be helpful and also pointers to
any apps, code snippets, or discussion that help with implementation
of this type of framework .

Thanks!

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

Reply via email to