Skip to content

Releases: citusdata/django-multitenant

v4.0.0

26 Sep 15:28
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v3.2.1...v4.0.0

v3.2.1

10 Apr 09:39
Compare
Choose a tag to compare
  • Add m2m with no through_defaults fix (#170)

v3.2.0

29 Mar 12:07
Compare
Choose a tag to compare
  • Adds DjangoRestFramework support (#157)

  • Adds guidelines to get model in migration (#167)

v3.1.1

22 Mar 05:36
Compare
Choose a tag to compare

Fixes #164 ManyToMany Non tenant model save issue

Django 4.1 support and more

03 Mar 08:11
12efe25
Compare
Choose a tag to compare
  • 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

08 Dec 17:42
cc57453
Compare
Choose a tag to compare

This release adds Django 4.0 support.

It also drops support for the following EOLed Django and Python versions:

  1. Python 2.7
  2. Django 1.11
  3. Django 3.1

Fix several bugs and add backwards Distribute migration

11 Nov 14:42
2ec88a2
Compare
Choose a tag to compare

Features

  • Backwards migration for Distribute migration using undistribute_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

17 May 22:42
Compare
Choose a tag to compare

Fix the process of running old migrations when the model has been deleted from the code.

Add tests on subquery joins

17 May 22:41
Compare
Choose a tag to compare

Add tests to confirm the join condition in subqueries includes tenant column.

Add tests for django 2.2

Add the possibility to custom Queryset

17 May 22:39
Compare
Choose a tag to compare
  • 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