Releases: citusdata/django-multitenant
Releases · citusdata/django-multitenant
Release list
v4.0.0
What's Changed
- Fixes citus 11.3 identity column bigint constraint by Gürkan İndibay (@gurkanindibay) in #181
- Adds Blogpost into Readme and updates python packages by Gürkan İndibay (@gurkanindibay) in #180
- Fix mispelling in README.md by Jason Novinger (@jnovinger) in #182
- Updating docs to show the importance of unsetting the tenant in a middleware by Arpan Mukherjee (@arpanpreneur) in #173
- Updates docs requirement version by Gürkan İndibay (@gurkanindibay) in #183
- Adds new python versions for dj3.2 by Gürkan İndibay (@gurkanindibay) in #188
- Update README.md by Ian Eaves (@ieaves) in #189
- Updates package versions by Gürkan İndibay (@gurkanindibay) in #191
- Adds additional citus and django versions by Gürkan İndibay (@gurkanindibay) in #197
New Contributors
- Jason Novinger (@jnovinger) made their first contribution in #182
- Arpan Mukherjee (@arpanpreneur) made their first contribution in #173
- Ian Eaves (@ieaves) made their first contribution in #189
Full Changelog: v3.2.1...v4.0.0
v3.2.1
- Add m2m with no through_defaults fix (#170)
v3.2.0
v3.1.1
Fixes #164 ManyToMany Non tenant model save issue
Django 4.1 support and more
-
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
Django 4.0 support
This release adds Django 4.0 support.
It also drops support for the following EOLed Django and Python versions:
- Python 2.7
- Django 1.11
- Django 3.1
Fix several bugs and add backwards Distribute migration
Features
- Backwards migration for
Distributemigration usingundistribute_table() - Add tests for Django 3.2 and Python 3.9
Fixes
- Fix migrations on Django 3.0+
- Fix aggregations using
annotate
Fix migration when model dropped
Fix the process of running old migrations when the model has been deleted from the code.
Add tests on subquery joins
Add tests to confirm the join condition in subqueries includes tenant column.
Add tests for django 2.2
Add the possibility to custom Queryset
- Users can now have their own queryset_class in TenantManager
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'
- Clean the delete code to ensure deleting rows only related to current tenant