MCPcopy
hub / github.com/ormar-orm/ormar / get

Method get

ormar/models/excludable.py:484–500  ·  view source on GitHub ↗

Return Excludable for given model and alias. :param model_cls: target model to check :type model_cls: ormar.models.metaclass.ModelMetaclass :param alias: table alias from relation manager :type alias: str :return: Excludable for given model and alias

(self, model_cls: type["Model"], alias: str = "")

Source from the content-addressed store, hash-verified

482 return exc is not None and bool(exc.include or exc.exclude)
483
484 def get(self, model_cls: type["Model"], alias: str = "") -> Excludable:
485 """
486 Return Excludable for given model and alias.
487
488 :param model_cls: target model to check
489 :type model_cls: ormar.models.metaclass.ModelMetaclass
490 :param alias: table alias from relation manager
491 :type alias: str
492 :return: Excludable for given model and alias
493 :rtype: ormar.models.excludable.Excludable
494 """
495 key = self._make_key(model_cls, alias)
496 excludable = self.items.get(key)
497 if not excludable:
498 excludable = Excludable()
499 self.items[key] = excludable
500 return excludable
501
502 def build(
503 self,

Callers 15

model_constructMethod · 0.45
skip_ellipsisFunction · 0.45
convert_allFunction · 0.45
is_field_flattenedMethod · 0.45
descendMethod · 0.45
walk_flatten_vs_selectorFunction · 0.45
_referenced_atMethod · 0.45

Calls 2

_make_keyMethod · 0.95
ExcludableClass · 0.85

Tested by 1