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

Class PkDescriptor

ormar/models/descriptors/descriptors.py:75–90  ·  view source on GitHub ↗

As of now it's basically a copy of PydanticDescriptor but that will change in the future with multi column primary keys

Source from the content-addressed store, hash-verified

73
74
75class PkDescriptor:
76 """
77 As of now it's basically a copy of PydanticDescriptor but that will
78 change in the future with multi column primary keys
79 """
80
81 def __init__(self, name: str) -> None:
82 self.name = name
83
84 def __get__(self, instance: "Model", owner: type["Model"]) -> Any:
85 value = instance.__dict__.get(self.name, None)
86 return value
87
88 def __set__(self, instance: "Model", value: Any) -> None:
89 instance._internal_set(self.name, value)
90 instance.set_save_status(False)
91
92
93class RelationDescriptor:

Callers 2

wire_proxy_from_parentFunction · 0.90
__new__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected