本文整理汇总了Python中django.db.models.sql.AND属性的典型用法代码示例。如果您正苦于以下问题:Python sql.AND属性的具体用法?Python sql.AND怎么用?Python sql.AND使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类django.db.models.sql
的用法示例。
在下文中一共展示了sql.AND属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __and__
# 需要导入模块: from django.db.models import sql [as 别名]
# 或者: from django.db.models.sql import AND [as 别名]
def __and__(self, other):
self._merge_sanity_check(other)
if isinstance(other, EmptyQuerySet):
return other
if isinstance(self, EmptyQuerySet):
return self
combined = self._clone()
combined._merge_known_related_objects(other)
combined.query.combine(other.query, sql.AND)
return combined
示例2: none
# 需要导入模块: from django.db.models import sql [as 别名]
# 或者: from django.db.models.sql import AND [as 别名]
def none(self):
"""
Returns an empty QuerySet.
"""
clone = self._clone()
clone.query.set_empty()
return clone
##################################################################
# PUBLIC METHODS THAT ALTER ATTRIBUTES AND RETURN A NEW QUERYSET #
##################################################################
示例3: __and__
# 需要导入模块: from django.db.models import sql [as 别名]
# 或者: from django.db.models.sql import AND [as 别名]
def __and__(self, other):
self._merge_sanity_check(other)
if isinstance(other, EmptyQuerySet):
return other
if isinstance(self, EmptyQuerySet):
return self
combined = self._chain()
combined._merge_known_related_objects(other)
combined.query.combine(other.query, sql.AND)
return combined
示例4: none
# 需要导入模块: from django.db.models import sql [as 别名]
# 或者: from django.db.models.sql import AND [as 别名]
def none(self):
"""Return an empty QuerySet."""
clone = self._chain()
clone.query.set_empty()
return clone
##################################################################
# PUBLIC METHODS THAT ALTER ATTRIBUTES AND RETURN A NEW QUERYSET #
##################################################################
示例5: __and__
# 需要导入模块: from django.db.models import sql [as 别名]
# 或者: from django.db.models.sql import AND [as 别名]
def __and__(self, other):
self._merge_sanity_check(other)
if isinstance(other, EmptyQuerySet):
return other._clone()
combined = self._clone()
combined._merge_known_related_objects(other)
combined.query.combine(other.query, sql.AND)
return combined
示例6: none
# 需要导入模块: from django.db.models import sql [as 别名]
# 或者: from django.db.models.sql import AND [as 别名]
def none(self):
"""
Returns an empty QuerySet.
"""
return self._clone(klass=EmptyQuerySet)
##################################################################
# PUBLIC METHODS THAT ALTER ATTRIBUTES AND RETURN A NEW QUERYSET #
##################################################################