Python/Django support for distributed multi-tenant databases like Postgres+Citus
MIT License
Full Changelog: https://github.com/citusdata/django-multitenant/compare/v3.2.1...v4.0.0
Published by gurkanindibay over 1 year ago
Published by gurkanindibay over 1 year ago
Adds DjangoRestFramework support (#157)
Adds guidelines to get model in migration (#167)
Published by gurkanindibay over 1 year ago
Fixes #164 ManyToMany Non tenant model save issue
Published by gurkanindibay over 1 year ago
Adds support for Django 4.1
Adds support for setting tenant automatically for ManyToMany related model
Fixes invalid error message problem in case of invalid field name
Adds support for getting models using apps.get_model
Removes reserved tenant_id limitation by introducing TenantMeta usage
Introduces ReadTheDocs documentation
Published by JelteF almost 3 years ago
This release adds Django 4.0 support.
It also drops support for the following EOLed Django and Python versions:
Published by JelteF almost 3 years ago
Distribute
migration using undistribute_table()
annotate
Published by louiseGrandjonc over 5 years ago
Fix the process of running old migrations when the model has been deleted from the code.
Published by louiseGrandjonc over 5 years ago
Add tests to confirm the join condition in subqueries includes tenant column.
Add tests for django 2.2
Published by louiseGrandjonc over 5 years ago
In version 2.0.6, a bug was introduced when doing
set_current_tenant(my_tenant)
MyModel.objects.create(name='test')
the tenant column wasn't filled. This fixes the issue
Published by louiseGrandjonc over 5 years ago
Fix recursive loop in warning for fields when joining without current_tenant set
Published by louiseGrandjonc over 5 years ago
Here is an example of the usecase
class TaskQueryset(models.QuerySet):
def opened(self):
return self.filter(opened=True)
def closed(self):
return self.filter(opened=False)
class TaskManager(TenantManagerMixin, models.Manager):
_queryset_class = TaskQueryset
def opened(self):
return self.get_queryset().opened()
def closed(self):
return self.get_queryset().closed()
class Task(TenantModelMixin, models.Model):
name = models.CharField(max_length=255)
project = TenantForeignKey(Project, on_delete=models.CASCADE,
related_name='tasks')
account = models.ForeignKey(Account, on_delete=models.CASCADE)
opened = models.BooleanField(default=True)
objects = TaskManager()
tenant_id = 'account_id'
Published by louiseGrandjonc over 5 years ago
In this version is introduced the concept of having multiple tenants as the current one making it possible to do
set_current_tenant([tenant_1, tenant_2])
It will add to the filter tenant_id__in=current_tenant
instead of tenant_id=current_tenant
Published by saicitus over 6 years ago
get_current_tenant
would cause errors due to the import statement triggering evaluation of the TenantModel class. This would cause problems if TenantModel were evaluated before the database backend was initialized.Published by saicitus almost 7 years ago
Some bug fixes.