MCPcopy
hub / github.com/django/django / KeyTransform

Class KeyTransform

django/contrib/postgres/fields/hstore.py:82–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80
81
82class KeyTransform(Transform):
83 output_field = TextField()
84
85 def __init__(self, key_name, *args, **kwargs):
86 super().__init__(*args, **kwargs)
87 self.key_name = key_name
88
89 def as_sql(self, compiler, connection):
90 lhs, params = compiler.compile(self.lhs)
91 return "(%s -> %%s)" % lhs, (*params, self.key_name)
92
93
94class KeyTransformFactory:

Callers 2

__call__Method · 0.70

Calls 1

TextFieldClass · 0.90

Tested by 1