citusdata / django-multitenant

Python/Django support for distributed multi-tenant databases like Postgres+Citus
MIT License
721 stars 119 forks source link

Resolving "tenant_id" name conflict in TenantModel class #8

Closed gsgalloway closed 6 years ago

gsgalloway commented 6 years ago

Given the following model:

class MyModel(TenantModel):
  data = models.StringField(...)
  tenant = models.ForeignKey(...)
  tenant_id = 'tenant_id'

the code generates

kwargs = { UUID('foobar'): UUID('foobar') }

when it should generate

kwargs = { 'tenant_id': UUID('foobar')}