【发布时间】:2017-01-23 05:17:45
【问题描述】:
我有以下型号:
class Show(models.Model):
cid = models.UUIDField(
default=uuid.uuid4,
editable=False,
verbose_name="Content ID",
help_text="Unique Identifier"
)
title_short = models.CharField(
max_length=60,
blank=True,
verbose_name="Short Title",
help_text="Short title (60 chars)"
)
我正在使用下面的sn-p
from django.contrib.postgres.search import SearchVector
Entry.objects.annotate(
search=SearchVector('cid'),
).filter(search='wateva')
返回:
DataError at /meta/shows/
invalid input syntax for uuid: ""
LINE 1: ...unt", to_tsvector(COALESCE("entities_show"."cid", '')) AS "s...
我尝试使用 PostgreSQL 9.3.14 和 PostgreSQL 9.5.3、Python 3.4.3
有人遇到过这个问题吗?
【问题讨论】:
标签: python django postgresql full-text-search uuid