我正在使用带有oracle后端的django 1.4
在我的models.py中,我有:
class ProteinTherapeutics(models.Model):
#...
class Meta:
db_table = 'mnowotka\".\"protein_therapeutics'
managed=False
而且:
ProteinTherapeutics.objects.exists()
产生这个SQL:
SELECT *
FROM
(SELECT ROWNUM AS "_RN",
"_SUB".*
FROM
(SELECT (1) AS "A"
FROM "MNOWOTKA"."PROTEIN_THERAPEFB7C") "_SUB"
WHERE ROWNUM <= 1)
WHERE "_RN" > 0 [1.99ms]
请帮帮我吗?
答案 0 :(得分:-1)
我猜问题是表名长度。我不知道django,但我认为它试图将名称 mnowotka“。”protein_therapeutics (31个字符)缩短为30个字符。也许像
这样的架构有一些元class ProteinTherapeutics(models.Model):
#...
class Meta:
db_table = 'protein_therapeutics'
schema = 'mnowotka'
managed=False