0

Thanks to the nice docs provided by the amazing app South, I managed to successfully rename a model using the code below:

def forwards(self, orm):
    db.rename_table('myapp_a_model', 'myapp_another_model')

def backwards(self, orm):
    db.rename_table('myapp_another_model','myapp_a_model')

However, the real name of the model contains upper-case letters, i.e. myapp_A_Model, and I want to rename myapp_A_Model to myapp_Another_Model. The uppercase letters matter to me. The challenge is that the code below:

db.rename_table('myapp_A_Model', 'myapp_Another_Model')

doesn't work. How do you rename a model into one with uppercase letters?

4

1 回答 1

0

事实证明,我对此有些困惑。

Django 模型名称可以是大写,而 PostGres 表名称都可以是小写。

于 2012-07-29T09:58:49.657 回答