本文整理汇总了Python中django.db.models.fields.BigIntegerField.get_db_prep_lookup方法的典型用法代码示例。如果您正苦于以下问题:Python BigIntegerField.get_db_prep_lookup方法的具体用法?Python BigIntegerField.get_db_prep_lookup怎么用?Python BigIntegerField.get_db_prep_lookup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类django.db.models.fields.BigIntegerField
的用法示例。
在下文中一共展示了BigIntegerField.get_db_prep_lookup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_db_prep_lookup
# 需要导入模块: from django.db.models.fields import BigIntegerField [as 别名]
# 或者: from django.db.models.fields.BigIntegerField import get_db_prep_lookup [as 别名]
def get_db_prep_lookup(self, lookup_type, value, connection=None, prepared=False):
if isinstance(value, SQLEvaluator) and isinstance(value.expression, Bit):
value = value.expression
if isinstance(value, (BitHandler, Bit)):
return BitQueryLookupWrapper(self.model._meta.db_table, self.name, value)
if connection is None:
return BigIntegerField.get_db_prep_lookup(self, lookup_type=lookup_type, value=value)
return BigIntegerField.get_db_prep_lookup(self, lookup_type=lookup_type, value=value,
connection=connection, prepared=prepared)
示例2: get_db_prep_lookup
# 需要导入模块: from django.db.models.fields import BigIntegerField [as 别名]
# 或者: from django.db.models.fields.BigIntegerField import get_db_prep_lookup [as 别名]
def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False):
if isinstance(value, SQLEvaluator) and isinstance(value.expression, Bit):
value = value.expression
if isinstance(value, (BitHandler, Bit)):
return [value.mask]
return BigIntegerField.get_db_prep_lookup(self, lookup_type=lookup_type, value=value,
connection=connection, prepared=prepared)
示例3: get_db_prep_lookup
# 需要导入模块: from django.db.models.fields import BigIntegerField [as 别名]
# 或者: from django.db.models.fields.BigIntegerField import get_db_prep_lookup [as 别名]
def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False):
if isinstance(getattr(value, 'expression', None), Bit):
value = value.expression
if isinstance(value, (BitHandler, Bit)):
if hasattr(self, 'class_lookups'):
# Django 1.7+
return [value.mask]
else:
return BitQueryLookupWrapper(self.model._meta.db_table, self.db_column or self.name, value)
return BigIntegerField.get_db_prep_lookup(self, lookup_type=lookup_type, value=value,
connection=connection, prepared=prepared)