| 272 | return expr.astext.cast(self.cast_type) |
| 273 | |
| 274 | class Json(ComparableEntity, Base): |
| 275 | __tablename__ = "json" |
| 276 | |
| 277 | id = Column( |
| 278 | sa.Integer, primary_key=True, test_needs_autoincrement=True |
| 279 | ) |
| 280 | json = Column(JSON, default={}) |
| 281 | field = index_property("json", "field") |
| 282 | json_field = index_property("json", "field") |
| 283 | int_field = json_property("json", "field", Integer) |
| 284 | text_field = json_property("json", "field", Text) |
| 285 | other = index_property("json", "other") |
| 286 | subfield = json_property("other", "field", Text) |
| 287 | |
| 288 | def test_query(self): |
| 289 | Json = self.classes.Json |