1
我有以下型號:Django的1.10全文由UUIDField搜索返回DataError
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)"
)
我使用下面的代碼片段
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
有沒有人遇到過這個問題?
這是門票: https://code.djangoproject.com/ticket/27227 –