Skip to content

Releases: citusdata/django-multitenant

Set multi current tenants

17 May 22:36
Compare
Choose a tag to compare

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

Fix create with current tenant

17 May 22:41
Compare
Choose a tag to compare

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

Recursive loop fix

17 May 22:40
Compare
Choose a tag to compare

Fix recursive loop in warning for fields when joining without current_tenant set

v1.1

25 Jun 23:46
Compare
Choose a tag to compare
  1. Add TenantForeignKey to emulate composite foreign keys between tenant related models.
  2. Split apart library into multiple files. Importing the utility function 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.
  3. Added a simple TenantOneToOneField which does not try to enforce a uniqueness constraint on the ID column, but preserves all the relationship semantics of using a traditional OneToOneField in Django.
  4. Overrode Django's DatabaseSchemaEditor to produce foreign key constraints on composite foreign keys consisting of both the ID and tenant ID columns for any foreign key between TenantModels
  5. Monkey-patched Django's DeleteQuery implementation to include tenant_id in its SQL queries.

v1.0.1

06 Nov 22:48
Compare
Choose a tag to compare

Some bug fixes.