本文整理汇总了Python中django.db.models.sql.constants.QUERY_TERMS.update方法的典型用法代码示例。如果您正苦于以下问题:Python QUERY_TERMS.update方法的具体用法?Python QUERY_TERMS.update怎么用?Python QUERY_TERMS.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类django.db.models.sql.constants.QUERY_TERMS
的用法示例。
在下文中一共展示了QUERY_TERMS.update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: monkey_patch_where_node
# 需要导入模块: from django.db.models.sql.constants import QUERY_TERMS [as 别名]
# 或者: from django.db.models.sql.constants.QUERY_TERMS import update [as 别名]
def monkey_patch_where_node():
global monkey_patched
if monkey_patched is True:
return
monkey_patched = True
if django.VERSION >= (1,5):
from django.db.models.sql.constants import QUERY_TERMS
QUERY_TERMS.update(UnaccentOperation.operators.keys() + UnaccentOperation.smart_operators)
# Update the operators accepted by a query when adding filters by adding those of unaccent
# This way, it passes the test at db/models/sql/query.py:1021 which otherwise will override our custom lookup_types
Query.query_terms.update(izip(UnaccentOperation.operators.keys() + UnaccentOperation.smart_operators, repeat(None)))
WhereNode.add = patched_wherenode_add
示例2: dict
# 需要导入模块: from django.db.models.sql.constants import QUERY_TERMS [as 别名]
# 或者: from django.db.models.sql.constants.QUERY_TERMS import update [as 别名]
'strictly_above',
'notextend_above',
'notextend_below',
'is_below',
'is_above',
'intersects',
'is_horizontal',
'is_perpendicular',
'is_parallel',
'contained_in_or_on',
'same_as',
'contains',
'center',
)
GEOMETRIC_LOOKUPS = dict((x, None) for x in geometric_lookups)
FTS_LOCKUPS = {'query': None, 'query_raw':None}
VARCHAR_LOOKUPS = dict((x, None) for x in ('unaccent', 'iunaccent'))
INTERVAL_LOOKUPS = dict((x, None) for x in ('distinct', 'exact', 'gt','lt','gte', 'lte'))
ARRAY_LOOKUPS = dict((x, None) for x in ('indexexact', 'distinct', 'slice', 'contains',
'containedby', 'overlap', 'exact', 'gt','lt','gte', 'lte'))
QUERY_TERMS.update(GEOMETRIC_LOOKUPS)
QUERY_TERMS.update(FTS_LOCKUPS)
QUERY_TERMS.update(VARCHAR_LOOKUPS)
QUERY_TERMS.update(INTERVAL_LOOKUPS)
QUERY_TERMS.update(ARRAY_LOOKUPS)
GEOMETRIC_TYPES = dict((x, None) for x in \
('box', 'point', 'line', 'lseg', 'path', 'polygon', 'circle'))
示例3: center
# 需要导入模块: from django.db.models.sql.constants import QUERY_TERMS [as 别名]
# 或者: from django.db.models.sql.constants.QUERY_TERMS import update [as 别名]
'center', # center(object)
'area', # area(object)
'area_gt',
'area_lt',
'area_gte',
'area_lte',
'overlap',
'strictly_left_of',
'strictly_right_of',
'notextendto_right_of',
'notextendto_left_of',
'strictly_below',
'strictly_above',
'notextend_above',
'notextend_below',
'is_below',
'is_above',
'intersects',
'is_horizontal',
'is_perpendicular',
'is_parallel',
'contained_in_or_on',
'contains',
'same_as',
)
QUERY_TERMS.update(dict([(x, None) for x in \
('indexexact', 'distinct', 'slice', 'containedby', 'unaccent', 'iunaccent', 'query')]))
QUERY_TERMS.update(dict([(x, None) for x in geometric_lookups]))
示例4:
# 需要导入模块: from django.db.models.sql.constants import QUERY_TERMS [as 别名]
# 或者: from django.db.models.sql.constants.QUERY_TERMS import update [as 别名]
# -*- coding: utf-8 -*-
from django.db.models.sql.constants import QUERY_TERMS
QUERY_TERMS.update(dict([(x, None) for x in ['unaccent', 'iunaccent']]))