ohmyapi 0.1.18__py3-none-any.whl → 0.1.19__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ohmyapi/db/model/model.py CHANGED
@@ -12,7 +12,7 @@ class ModelMeta(type(TortoiseModel)):
12
12
  class BoundSchema:
13
13
  @property
14
14
  def model(self):
15
- """Return a Pydantic model class for 'one' results."""
15
+ """Return a Pydantic model class for serializing results."""
16
16
  include = getattr(schema_opts, "include", None)
17
17
  exclude = getattr(schema_opts, "exclude", None)
18
18
  return pydantic_model_creator(
@@ -20,6 +20,18 @@ class ModelMeta(type(TortoiseModel)):
20
20
  name=f"{new_cls.__name__}Schema",
21
21
  include=include,
22
22
  exclude=exclude,
23
+ )
24
+
25
+ @property
26
+ def readonly(self):
27
+ """Return a Pydantic model class for serializing readonly results."""
28
+ include = getattr(schema_opts, "include", None)
29
+ exclude = getattr(schema_opts, "exclude", None)
30
+ return pydantic_model_creator(
31
+ new_cls,
32
+ name=f"{new_cls.__name__}SchemaReadonly",
33
+ include=include,
34
+ exclude=exclude,
23
35
  exclude_readonly=True,
24
36
  )
25
37
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ohmyapi
3
- Version: 0.1.18
3
+ Version: 0.1.19
4
4
  Summary: A Django-like but async web-framework based on FastAPI and TortoiseORM.
5
5
  License-Expression: MIT
6
6
  Keywords: fastapi,tortoise,orm,async,web-framework
@@ -17,9 +17,9 @@ ohmyapi/core/templates/project/settings.py.j2,sha256=RBKGB8MZWPM3Bp0a57Y1YrSvSXx
17
17
  ohmyapi/db/__init__.py,sha256=T7AUWlEXD--WOn01mKPIpkxPVwmgYHZQ4vQo3ejOkgE,204
18
18
  ohmyapi/db/exceptions.py,sha256=I7AubrdqQF_UvAvzKqz2ve08-BkXHzEWXnwG300StHE,35
19
19
  ohmyapi/db/model/__init__.py,sha256=k3StTNuKatpwZo_Z5JBFa-927eJrzibFE8U4SA82asc,32
20
- ohmyapi/db/model/model.py,sha256=6Qzra6YaUCEPjw6hl5chfMUfIt-IRZbkNTrQvWOQ_TI,1095
20
+ ohmyapi/db/model/model.py,sha256=2q1psrjNfKzKTR3n5YC20o3x_8Ytg91BatjFudjJwTg,1600
21
21
  ohmyapi/router.py,sha256=hutccsrP9RT8W5O6uBDhOJehwqrkRoPzaUI5zoHPh9A,55
22
- ohmyapi-0.1.18.dist-info/METADATA,sha256=_MZsyVUH8n0KeHJq_b-92mXZoPVt-q2LG6__mHjM71U,8783
23
- ohmyapi-0.1.18.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
24
- ohmyapi-0.1.18.dist-info/entry_points.txt,sha256=wb3lw8-meAlpiv1mqcQ3m25ukL7djagU_w89GkrC37k,43
25
- ohmyapi-0.1.18.dist-info/RECORD,,
22
+ ohmyapi-0.1.19.dist-info/METADATA,sha256=YJZYpypPSjJPVekXWNVuWIGAYQJM2HbH3SE7g7ceg4k,8783
23
+ ohmyapi-0.1.19.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
24
+ ohmyapi-0.1.19.dist-info/entry_points.txt,sha256=wb3lw8-meAlpiv1mqcQ3m25ukL7djagU_w89GkrC37k,43
25
+ ohmyapi-0.1.19.dist-info/RECORD,,