Closed pickyuptruck closed 4 years ago
Hi,
to use ManyToMany
with django-multitenant, you need to add a through
model. In the citus documentationn, we put an example: https://docs.citusdata.com/en/v9.4/develop/migration_mt_django.html?#introducing-the-tenant-column-to-models-belonging-to-an-account
It's needed to shard the query to retrieve/delete the rows in the table.
What version of django are you using?
Seems to be related to Django 3.X. I'm fixing it and will notify you once it's released
Hi @pickyuptruck, it should be fixed in version 2.3.0
Works a treat! Thanks very much, and thank you for this brilliant package.
one final question: are through models essential? Things seem to be working fine without them
The through model is not essential. It's required for distributed databases though. So if you decided to shard your database on the column school_id and wanted to distribute the members
relation. If you're not using a distributed database, then it works perfectly fine :)
I have the following models:
models.py
Attempting to delete a Department instance throws the error "TypeError: related_objects() takes 3 positional arguments but 4 were given". This happens even if a tenanted through model is used.
Traceback