fastlifeweb 0.27.0__py3-none-any.whl → 0.27.1__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.
CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.27.1 - Released on 2025-07-10
2
+ * Add response_model to @resource_view in order to document views that use StreamResponse.
3
+
1
4
  ## 0.27.0 - Released on 2025-04-24
2
5
  * Add i18n support on pydantic form.
3
6
 
fastlife/assets/dist.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v4.1.4 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */
2
2
  @layer properties;
3
3
  @layer theme, base, components, utilities;
4
4
  @layer theme {
@@ -288,6 +288,9 @@
288
288
  .cursor-pointer {
289
289
  cursor: pointer;
290
290
  }
291
+ .appearance-none {
292
+ appearance: none;
293
+ }
291
294
  .items-center {
292
295
  align-items: center;
293
296
  }
@@ -20,13 +20,17 @@
20
20
  "specify how the response will be swapped in relative to the target of an AJAX request."
21
21
  ] = "innerHTML show:body:top",
22
22
  hx_push_url: Annotated[bool, "replace the browser url with the link."] = True,
23
+ hx_get: Annotated[
24
+ str | None,
25
+ "Override the target link only for htmx request for component rendering. href will be used if None."
26
+ ] = None,
23
27
  disable_htmx: Annotated[bool, "do not add any `hx-*` attibute to the link."] = False
24
28
  #}
25
29
 
26
30
  <a href="{{href}}"
27
31
  {%- if id %} id="{{ id }}" {%- endif %}
28
32
  {%- if not disable_htmx %}
29
- hx-get="{{ href }}"
33
+ hx-get="{{ hx_get or href }}"
30
34
  hx-target="{{ hx_target }}"
31
35
  hx-swap="{{ hx_swap }}"
32
36
  {%- if hx_push_url %} hx-push-url="true" {%- endif %}
@@ -368,7 +368,7 @@ class GenericConfigurator(Generic[TRegistry]):
368
368
  deprecated: bool | None = None,
369
369
  methods: list[str] | None = None,
370
370
  operation_id: str | None = None,
371
- # response_model: Any = Default(None),
371
+ response_model: Any = None,
372
372
  response_model_include: IncEx | None = None,
373
373
  response_model_exclude: IncEx | None = None,
374
374
  response_model_by_alias: bool = True,
@@ -433,7 +433,7 @@ class GenericConfigurator(Generic[TRegistry]):
433
433
  self._current_router.add_api_route(
434
434
  path,
435
435
  endpoint,
436
- # response_model=response_model,
436
+ response_model=response_model,
437
437
  status_code=status_code,
438
438
  tags=tags,
439
439
  dependencies=dependencies,
@@ -99,6 +99,7 @@ def resource(
99
99
  response_description=endpoint.response_description,
100
100
  deprecated=endpoint.deprecated,
101
101
  operation_id=endpoint.operation_id,
102
+ response_model=endpoint.response_model,
102
103
  response_model_include=endpoint.response_model_include,
103
104
  response_model_exclude=endpoint.response_model_exclude,
104
105
  response_model_by_alias=endpoint.response_model_by_alias,
@@ -146,6 +147,7 @@ def resource_view(
146
147
  deprecated: bool | None = None,
147
148
  methods: list[str] | None = None,
148
149
  operation_id: str | None = None,
150
+ response_model: type[Any] | None = None,
149
151
  response_model_include: IncEx | None = None,
150
152
  response_model_exclude: IncEx | None = None,
151
153
  response_model_by_alias: bool = True,
@@ -155,7 +157,7 @@ def resource_view(
155
157
  include_in_schema: bool = True,
156
158
  openapi_extra: dict[str, Any] | None = None,
157
159
  ) -> Callable[..., Any]:
158
- """ "
160
+ """
159
161
  Decorator to use on a method of a class decorated with {func}`resource` in order
160
162
  to add OpenAPI information.
161
163
 
@@ -177,8 +179,11 @@ def resource_view(
177
179
  :param include_in_schema: Expose or not the route in the OpenAPI schema and
178
180
  documentation.
179
181
 
180
- :param response_model_include: customize fields list to include in repsonse.
181
- :param response_model_exclude: customize fields list to exclude in repsonse.
182
+ :param response_model: class used for the api documentation for streaming response.
183
+ It may also be used to validate data in case the view return dict.
184
+ See [FastAPI doc](https://fastapi.tiangolo.com/tutorial/response-model/).
185
+ :param response_model_include: customize fields list to include in response.
186
+ :param response_model_exclude: customize fields list to exclude in response.
182
187
  :param response_model_by_alias: serialize fields by alias or by name if False.
183
188
  :param response_model_exclude_unset: exclude fields that are not explicitly
184
189
  set in response.
@@ -197,6 +202,7 @@ def resource_view(
197
202
  fn.deprecated = deprecated
198
203
  fn.methods = methods
199
204
  fn.operation_id = operation_id
205
+ fn.response_model = response_model
200
206
  fn.response_model_include = response_model_include
201
207
  fn.response_model_exclude = response_model_exclude
202
208
  fn.response_model_by_alias = response_model_by_alias
@@ -29,6 +29,7 @@ class Globals(BaseModel):
29
29
  """Default css class for {jinjax:component}`A`."""
30
30
 
31
31
  BUTTON_CLASS: str = space_join(
32
+ "appearance-none",
32
33
  "bg-primary-600",
33
34
  "px-5",
34
35
  "py-2.5",
@@ -52,6 +53,7 @@ class Globals(BaseModel):
52
53
  """Default css class for {jinjax:component}`Details`."""
53
54
 
54
55
  SECONDARY_BUTTON_CLASS: str = space_join(
56
+ "appearance-none",
55
57
  "bg-neutral-300",
56
58
  "px-5",
57
59
  "py-2.5",
@@ -79,6 +81,7 @@ class Globals(BaseModel):
79
81
  """
80
82
 
81
83
  ICON_BUTTON_CLASS: str = space_join(
84
+ "appearance-none",
82
85
  "bg-white",
83
86
  "p-1",
84
87
  "rounded-xs",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastlifeweb
3
- Version: 0.27.0
3
+ Version: 0.27.1
4
4
  Summary: High-level web framework
5
5
  Author-Email: Guillaume Gauvrit <guillaume@gauvr.it>
6
6
  License: MIT
@@ -77,7 +77,7 @@ to maintain and scale your project.
77
77
 
78
78
  ## Tests
79
79
 
80
- Fastlife come with [a test client](https://mardiros.github.io/fastlife/develop/fastlife/fastlife.testing.testclient.html) that can interact with html inside unit tests.
80
+ Fastlife comes with [a test client](https://mardiros.github.io/fastlife/develop/fastlife/fastlife.testing.testclient.html) that can interact with html inside unit tests.
81
81
 
82
82
 
83
83
  ## Try it
@@ -1,4 +1,4 @@
1
- CHANGELOG.md,sha256=SaMUOfsgJvjHaEzgvgmtggz0FY0YEqltXogCMACKrvc,8904
1
+ CHANGELOG.md,sha256=EdwLpgFV0D5skxaZ0DbAtJPkk2QwLDt8sGNVqSGQJ28,9032
2
2
  fastlife/__init__.py,sha256=Fe8JiQyKIN1WGagUGFct-QBW8-Ku5vXhc_7BkFUGcWk,2475
3
3
  fastlife/adapters/__init__.py,sha256=imPD1hImpgrYkvUJRhHA5kVyGAua7VbP2WGkhSWKJT8,93
4
4
  fastlife/adapters/fastapi/__init__.py,sha256=1goV1FGFP04TGyskJBLKZam4Gvt1yoAvLMNs4ekWSSQ,243
@@ -42,9 +42,9 @@ fastlife/adapters/jinjax/widgets/model.py,sha256=STojkUMfCP1kyPFzzWS-MIZOoxAEFHT
42
42
  fastlife/adapters/jinjax/widgets/sequence.py,sha256=aL93-ytj6nlbT8vumt3br6Jq8D97iiCXU3eQXrGYuG0,2577
43
43
  fastlife/adapters/jinjax/widgets/text.py,sha256=XKpoLoBNsvQhHrezKCEcXlF9iQzuclXGaeFu6uq9_5A,3390
44
44
  fastlife/adapters/jinjax/widgets/union.py,sha256=fNWmAXNEPkDbP14q6HmlD65L7q5_JmspZ_IG_SqB_NM,2624
45
- fastlife/assets/dist.css,sha256=d2ez-igscOaeYtJQc2FQuXlN17cYX13sUansFdg_kdA,19753
45
+ fastlife/assets/dist.css,sha256=xuD2jjSO5GMCjyr_rmhcazJQ5wQpcYUvFxKm0RcC1XY,19801
46
46
  fastlife/assets/source.css,sha256=0KtDcsKHj9LOcqNR1iv9pACwNBaNWkieEDqqjkgNL_s,47
47
- fastlife/components/A.jinja,sha256=MDNJ2auIeYbpNeErvJdlGid4nIKfbi85ArmMgChsCJU,1384
47
+ fastlife/components/A.jinja,sha256=hTZeYWXKLgnqPucSrF2IY7TDP4d_xNfU2Rjl-bXnpGc,1548
48
48
  fastlife/components/Button.jinja,sha256=itKU-ct45XissU33yfmTekyHsNe00fr4RQL-e9cxbgU,2305
49
49
  fastlife/components/Checkbox.jinja,sha256=g62A1LR8TaN60h94pE2e5l9_eMmgnhVVE9HVCQtVVMo,748
50
50
  fastlife/components/CsrfToken.jinja,sha256=mS0q-3_hAevl_waWEPaN0QAYOBzMyzl-W1PSpEHUBA0,215
@@ -1690,10 +1690,10 @@ fastlife/components/pydantic_form/FatalError.jinja,sha256=ADtQvmo-e-NmDcFM1E6wZV
1690
1690
  fastlife/components/pydantic_form/Hint.jinja,sha256=8leBpfMGDmalc_KAjr2paTojr_rwq-luS6m_1BGj7Tw,202
1691
1691
  fastlife/components/pydantic_form/Widget.jinja,sha256=PgguUpvhG6CY9AW6H8qQMjKqjlybjDCAaFFAOHzrzVQ,418
1692
1692
  fastlife/config/__init__.py,sha256=5qpuaVYqi-AS0GgsfggM6rFsSwXgrqrLBo9jH6dVroc,407
1693
- fastlife/config/configurator.py,sha256=82YEVRoI6VoyFPIbkWgnqlLIVNSVP9TUkbKl6qksWs8,24898
1693
+ fastlife/config/configurator.py,sha256=WVV6UIqVBQDNh_YuRIpRTo6O_-_Ut-ZqW8SNeMAujYI,24885
1694
1694
  fastlife/config/exceptions.py,sha256=9MdBnbfy-Aw-KaIFzju0Kh8Snk41-v9LqK2w48Tdy1s,1169
1695
1695
  fastlife/config/openapiextra.py,sha256=rYoerrn9sni2XwnO3gIWqaz7M0aDZPhVLjzqhDxue0o,514
1696
- fastlife/config/resources.py,sha256=EcPTM25pnHcGFTtXjeZnWn5Mo_-8rhJ72HJ6rxnjPg8,8389
1696
+ fastlife/config/resources.py,sha256=stKCuZQGgiDW9xTrTNxKMb_JzkgkM1Ubum1b7OK4Lm4,8780
1697
1697
  fastlife/config/views.py,sha256=9CZ0qNi8vKvQuGo1GgM6cwNK8WwHOxwIHqtikAOaOHY,2399
1698
1698
  fastlife/domain/__init__.py,sha256=3zDDos5InVX0el9OO0lgSDGzdUNYIhlA6w4uhBh2pF8,29
1699
1699
  fastlife/domain/model/__init__.py,sha256=aoBjaSpDscuFXvtknJHwiNyoJRUpE-v4X54h_wNuo2Y,27
@@ -1726,7 +1726,7 @@ fastlife/settings.py,sha256=q-rz4CEF2RQGow5-m-yZJOvdh3PPb2c1Q_ZLJGnu4VQ,3647
1726
1726
  fastlife/shared_utils/__init__.py,sha256=i66ytuf-Ezo7jSiNQHIsBMVIcB-tDX0tg28-pUOlhzE,26
1727
1727
  fastlife/shared_utils/infer.py,sha256=0GflLkaWJ-4LZ1Ig3moR-_o55wwJ_p_vJ4xo-yi3lyA,1406
1728
1728
  fastlife/shared_utils/resolver.py,sha256=Wb9cO2MWavpti63hju15xmwFMgaD5DsQaxikRpB39E8,3713
1729
- fastlife/template_globals.py,sha256=bKcj6kSnQlzuOeoILA5oRxxzy6CsrBFMZv9S0w5XlTQ,9021
1729
+ fastlife/template_globals.py,sha256=pn2fWRE5QwYii4K0XJtfCt1hUmN8VvXXwAOWSwRFe94,9102
1730
1730
  fastlife/testing/__init__.py,sha256=VpxkS3Zp3t_hH8dBiLaGFGhsvt511dhBS_8fMoFXdmU,99
1731
1731
  fastlife/testing/dom.py,sha256=q2GFrHWjwKMMTR0dsP3J-rXSxojZy8rOQ-07h2gfLKA,5869
1732
1732
  fastlife/testing/form.py,sha256=diiGfVMfNt19JTNUxlnbGfcbskR3ZMpk0Y-A57vfShc,7871
@@ -1734,8 +1734,8 @@ fastlife/testing/session.py,sha256=LEFFbiR67_x_g-ioudkY0C7PycHdbDfaIaoo_G7GXQ8,2
1734
1734
  fastlife/testing/testclient.py,sha256=gqgHQalhrLLZ8eveN2HeuoG9ne8CwxCm-Ll4b7jo9Xo,7249
1735
1735
  fastlife/views/__init__.py,sha256=zG8gveL8e2zBdYx6_9jtZfpQ6qJT-MFnBY3xXkLwHZI,22
1736
1736
  fastlife/views/pydantic_form.py,sha256=M4uGP-QiDuSyrkYAsvSVJYZzdBUPOmCghQdwtR28K5E,1630
1737
- fastlifeweb-0.27.0.dist-info/METADATA,sha256=5cvmsfd1YF7lhRZtH53Ip9Qxd7EwE54AQK4pFV2IChI,3690
1738
- fastlifeweb-0.27.0.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
1739
- fastlifeweb-0.27.0.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
1740
- fastlifeweb-0.27.0.dist-info/licenses/LICENSE,sha256=JFWuiKYRXKKMEAsX0aZp3hBcju-HYflJ2rwJAGwbCJo,1080
1741
- fastlifeweb-0.27.0.dist-info/RECORD,,
1737
+ fastlifeweb-0.27.1.dist-info/METADATA,sha256=Ztrqc7ngoilivkBACoQ2P94LAbPHQhuEORjLkiO7weQ,3691
1738
+ fastlifeweb-0.27.1.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
1739
+ fastlifeweb-0.27.1.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
1740
+ fastlifeweb-0.27.1.dist-info/licenses/LICENSE,sha256=JFWuiKYRXKKMEAsX0aZp3hBcju-HYflJ2rwJAGwbCJo,1080
1741
+ fastlifeweb-0.27.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: pdm-backend (2.4.4)
2
+ Generator: pdm-backend (2.4.5)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any