Skip to content
This repository has been archived by the owner on Jan 6, 2019. It is now read-only.

Store table information on models and use that #3

Open
kissgyorgy opened this issue Mar 10, 2014 · 1 comment
Open

Store table information on models and use that #3

kissgyorgy opened this issue Mar 10, 2014 · 1 comment
Assignees

Comments

@kissgyorgy
Copy link
Owner

from django.db import models

class SomeModel(models.Model):
    # ...
    class Meta:
        public_tenant = True
        shared_tenant = True

This way, it is possible to use existing apps with the default setting to public schema (they are synced to public anyway) and mix tenant-aware schemas.

@kissgyorgy
Copy link
Owner Author

This way, contrib app models cannot be modified, so instead of this, use the new appconfig in 1.7 somehow and set public and tenant models on that.
Something like:

from django.apps import AppConfig

class TenantAwareAppConfig(AppConfig):
    name = 'some_tenant_app'
    verbose_name = "Some tenant app"
    shared_models = ['Tickets', 'Orders']
    tenant_models = ['Users']

Seems too complicated though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant