MCPcopy Create free account
hub / github.com/schematics/schematics / Location

Class Location

tests/test_serialize.py:13–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12def test_serializable():
13 class Location(Model):
14 country_code = StringType()
15
16 @serializable
17 def country_name(self):
18 return "United States" if self.country_code == "US" else "Unknown"
19
20 location_US = Location({"country_code": "US"})
21

Calls 1

StringTypeClass · 0.90

Used in the wild real call sites across dependent graphs

searching dependent graphs…