How to remove the prefix of a table for a Django model?

前端 未结 4 537
难免孤独
难免孤独 2020-12-28 16:17

I create a new Django app (not project) called Bussinesses, then add following class to the models.py.

class Bussinesses(models.Model):
    busi         


        
4条回答
  •  执笔经年
    2020-12-28 16:41

    You can specify the table name in the model's Meta class, using the db_table property.

    Also, if you're using a database table that already exists, you might also want to take a look at the managed property. After setting a model to unmanaged syncdb will not affect it (if you reset your app, for instance), but you can still use Django's ORM normally.

提交回复
热议问题