【发布时间】:2015-10-02 23:33:11
【问题描述】:
我有这两个模型:
class CachedRecord(models.Model):
recordname = models.CharField(max_length=100,primary_key=True)
recordcount = models.IntegerField()
def __unicode__(self):
return self.recordname
class CachedRecordData(models.Model):
record = models.ForeignKey(CachedRecord)
data = models.CharField(max_length=100)
def __unicode__(self):
return self.data
当我尝试从管理面板中删除 CachedRecord 时,出现以下错误:
ProgrammingError at /admin/myapp/cachedrecord/
operator does not exist: integer = character varying
LINE 1: ...ON ( "myapp_cachedrecorddata"."record_id" = "myapp...
^
HINT: No operator matches the given name and argument type(s).
You might need to add explicit type casts.
我发现了很多问题(所以这可能是重复的),但我真的不明白任何答案。
我需要在 django 中的哪里添加这些铸件?
【问题讨论】:
标签: python django postgresql