MCPcopy Index your code
hub / github.com/apache/cassandra-python-driver / __get__

Method __get__

cassandra/cqlengine/models.py:90–105  ·  view source on GitHub ↗

:rtype: ModelQuerySet

(self, obj, model)

Source from the content-addressed store, hash-verified

88 """
89
90 def __get__(self, obj, model):
91 """ :rtype: ModelQuerySet """
92 if model.__abstract__:
93 raise CQLEngineException('cannot execute queries against abstract models')
94 queryset = model.__queryset__(model)
95
96 # if this is a concrete polymorphic model, and the discriminator
97 # key is an indexed column, add a filter clause to only return
98 # logical rows of the proper type
99 if model._is_polymorphic and not model._is_polymorphic_base:
100 name, column = model._discriminator_column_name, model._discriminator_column
101 if column.partition_key or column.index:
102 # look for existing poly types
103 return queryset.filter(**{name: model.__discriminator_value__})
104
105 return queryset
106
107 def __call__(self, *args, **kwargs):
108 """

Callers

nothing calls this directly

Calls 2

CQLEngineExceptionClass · 0.90
filterMethod · 0.45

Tested by

no test coverage detected