0

Thank you for reading i am new to Django and For my application it's a requirement to create a table for each client to store his data. Each client table has the same data so i made a Model for it.

But the table name is variable: i tried

Models.py


    class Meta:
        abstract = True


    organisation = models.CharField(max_length=255, null=True, blank=True,)```

Model
```class Test(DatIm):

    class Meta(DataIm.Meta):
        db_table = DatIm.organisation```

in the view: 
 ```Test.objects.update_or_create(organisation=row['organisation'])```

but it doesnt  create the table  and gives errors. 



i  would expect to 
creates or get the table for organisation
insert model.save data in organisation Db 
I need for each organisation an table because a lot of data. 
Pearl
  • 39
  • 7

0 Answers0