reflex 0.6.5a2__py3-none-any.whl → 0.6.5a3__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.

Potentially problematic release.


This version of reflex might be problematic. Click here for more details.

reflex/state.py CHANGED
@@ -46,6 +46,7 @@ from reflex import event
46
46
  from reflex.config import get_config
47
47
  from reflex.istate.data import RouterData
48
48
  from reflex.istate.storage import ClientStorageBase
49
+ from reflex.model import Model
49
50
  from reflex.vars.base import (
50
51
  ComputedVar,
51
52
  DynamicRouteVar,
@@ -1733,15 +1734,20 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
1733
1734
  if value is None:
1734
1735
  continue
1735
1736
  hinted_args = value_inside_optional(hinted_args)
1736
- if (
1737
- isinstance(value, dict)
1738
- and inspect.isclass(hinted_args)
1739
- and (
1740
- dataclasses.is_dataclass(hinted_args)
1741
- or issubclass(hinted_args, Base)
1742
- )
1743
- ):
1744
- payload[arg] = hinted_args(**value)
1737
+ if isinstance(value, dict) and inspect.isclass(hinted_args):
1738
+ if issubclass(hinted_args, Model):
1739
+ # Remove non-fields from the payload
1740
+ payload[arg] = hinted_args(
1741
+ **{
1742
+ key: value
1743
+ for key, value in value.items()
1744
+ if key in hinted_args.__fields__
1745
+ }
1746
+ )
1747
+ elif dataclasses.is_dataclass(hinted_args) or issubclass(
1748
+ hinted_args, Base
1749
+ ):
1750
+ payload[arg] = hinted_args(**value)
1745
1751
  if isinstance(value, list) and (hinted_args is set or hinted_args is Set):
1746
1752
  payload[arg] = set(value)
1747
1753
  if isinstance(value, list) and (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: reflex
3
- Version: 0.6.5a2
3
+ Version: 0.6.5a3
4
4
  Summary: Web apps in pure Python.
5
5
  Home-page: https://reflex.dev
6
6
  License: Apache-2.0
@@ -33,7 +33,7 @@ Requires-Dist: python-multipart (>=0.0.5,<0.1)
33
33
  Requires-Dist: python-socketio (>=5.7.0,<6.0)
34
34
  Requires-Dist: redis (>=4.3.5,<6.0)
35
35
  Requires-Dist: reflex-chakra (>=0.6.0)
36
- Requires-Dist: reflex-hosting-cli (>=0.1.5,<2.0)
36
+ Requires-Dist: reflex-hosting-cli (>=0.1.15,<2.0)
37
37
  Requires-Dist: rich (>=13.0.0,<14.0)
38
38
  Requires-Dist: setuptools (>=75.0)
39
39
  Requires-Dist: sqlmodel (>=0.0.14,<0.1)
@@ -357,7 +357,7 @@ reflex/model.py,sha256=AaCs6V9iWFj-EZI7zfXL1LTy-TrnNfJKVit2MPqLM8M,14139
357
357
  reflex/page.py,sha256=N85R5tTI-NoFd9ArwYCN8OcV9aSPZIPrJI2ZFbH8ytk,2389
358
358
  reflex/reflex.py,sha256=R8_NLSfX2IhlZlZkXvlIWMS9FUGNqzOHB2NcP-GYSMY,22705
359
359
  reflex/route.py,sha256=WZS7stKgO94nekFFYHaOqNgN3zZGpJb3YpGF4ViTHmw,4198
360
- reflex/state.py,sha256=SkLd68t6lH64-gkekc4Jl7bw9kdUpK6rKB9_23M_ZEY,131617
360
+ reflex/state.py,sha256=qangQJoffJ_EZWjKOoMkmyklzh9vC9u7P9NxnW5poxo,131976
361
361
  reflex/style.py,sha256=-mBrpaq23jiNJIwgCir6Fzj182u9rGpp3qZ2cUt5aZs,12695
362
362
  reflex/testing.py,sha256=qkLVNeLcD3uxTg95WuV1IYoEhkmEdJ7o8Fbc8NaeoRQ,34792
363
363
  reflex/utils/__init__.py,sha256=y-AHKiRQAhk2oAkvn7W8cRVTZVK625ff8tTwvZtO7S4,24
@@ -387,8 +387,8 @@ reflex/vars/function.py,sha256=1E-yBhP3sOTVmVotSA6S8PY2c63yl0DJvr0oZh7j2bg,6854
387
387
  reflex/vars/number.py,sha256=BeHQr4Cj2gdXekEWcxSzLTIuRAC3sf6YvsdHlADETpQ,27499
388
388
  reflex/vars/object.py,sha256=dTfkkUGDmoxu7iPcKSnNJ-lTI48yoXbagUyA-lKwDDo,14335
389
389
  reflex/vars/sequence.py,sha256=mlmOkSV8FIxwdJHzQdu3NzHAoNB4KcGc93dcmdviIoo,49916
390
- reflex-0.6.5a2.dist-info/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
391
- reflex-0.6.5a2.dist-info/METADATA,sha256=AjUUppCnktkGtTa-GXRNNpA0fQjJNkFxSWkmIEeK7MY,12057
392
- reflex-0.6.5a2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
393
- reflex-0.6.5a2.dist-info/entry_points.txt,sha256=H1Z5Yat_xJfy0dRT1Frk2PkO_p41Xy7fCKlj4FcdL9o,44
394
- reflex-0.6.5a2.dist-info/RECORD,,
390
+ reflex-0.6.5a3.dist-info/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
391
+ reflex-0.6.5a3.dist-info/METADATA,sha256=3MZwzF3zH_gEsLGZ9pQxPaZv9wQaxVMO367XA_5XLLs,12058
392
+ reflex-0.6.5a3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
393
+ reflex-0.6.5a3.dist-info/entry_points.txt,sha256=H1Z5Yat_xJfy0dRT1Frk2PkO_p41Xy7fCKlj4FcdL9o,44
394
+ reflex-0.6.5a3.dist-info/RECORD,,