fix tests and hardcoded constants
This commit is contained in:
parent
9f3752ea74
commit
bec66b894e
@ -62,16 +62,20 @@ class CompileVars(SimpleNamespace):
|
|||||||
# The name of the function for converting a dict to an event.
|
# The name of the function for converting a dict to an event.
|
||||||
TO_EVENT = "Event"
|
TO_EVENT = "Event"
|
||||||
# The name of the internal on_load event.
|
# The name of the internal on_load event.
|
||||||
ON_LOAD_INTERNAL = "reflex___state____on_load_internal_state.on_load_internal"
|
ON_LOAD_INTERNAL = (
|
||||||
|
"reflex___istate___builtins____on_load_internal_state.on_load_internal"
|
||||||
|
)
|
||||||
# The name of the internal event to update generic state vars.
|
# The name of the internal event to update generic state vars.
|
||||||
UPDATE_VARS_INTERNAL = (
|
UPDATE_VARS_INTERNAL = (
|
||||||
"reflex___state____update_vars_internal_state.update_vars_internal"
|
"reflex___istate___builtins____update_vars_internal_state.update_vars_internal"
|
||||||
)
|
)
|
||||||
# The name of the frontend event exception state
|
# The name of the frontend event exception state
|
||||||
FRONTEND_EXCEPTION_STATE = "reflex___state____frontend_event_exception_state"
|
FRONTEND_EXCEPTION_STATE = (
|
||||||
|
"reflex___istate___builtins____frontend_event_exception_state"
|
||||||
|
)
|
||||||
# The full name of the frontend exception state
|
# The full name of the frontend exception state
|
||||||
FRONTEND_EXCEPTION_STATE_FULL = (
|
FRONTEND_EXCEPTION_STATE_FULL = (
|
||||||
f"reflex___state____state.{FRONTEND_EXCEPTION_STATE}"
|
f"reflex___istate___builtins____state.{FRONTEND_EXCEPTION_STATE}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -879,11 +879,13 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
|
|||||||
|
|
||||||
if len(path) == 0:
|
if len(path) == 0:
|
||||||
return cls
|
return cls
|
||||||
|
print("get_name: ", cls.get_name())
|
||||||
if path[0] == cls.get_name():
|
if path[0] == cls.get_name():
|
||||||
if len(path) == 1:
|
if len(path) == 1:
|
||||||
return cls
|
return cls
|
||||||
path = path[1:]
|
path = path[1:]
|
||||||
for substate in cls.get_substates():
|
for substate in cls.get_substates():
|
||||||
|
print("substate get_name: ", substate.get_name())
|
||||||
if path[0] == substate.get_name():
|
if path[0] == substate.get_name():
|
||||||
return substate.get_class_substate(path[1:])
|
return substate.get_class_substate(path[1:])
|
||||||
raise ValueError(f"Invalid path: {path}")
|
raise ValueError(f"Invalid path: {path}")
|
||||||
|
Loading…
Reference in New Issue
Block a user