Răsfoiți Sursa

Fix event encoding (#393)

Nikhil Rao 2 ani în urmă
părinte
comite
a5bd23d792
2 a modificat fișierele cu 1 adăugiri și 9 ștergeri
  1. 1 1
      pynecone/event.py
  2. 0 8
      pynecone/var.py

+ 1 - 1
pynecone/event.py

@@ -64,7 +64,7 @@ class EventHandler(Base):
 
             # Otherwise, convert to JSON.
             try:
-                values.append(json.dumps(arg))
+                values.append(json.dumps(arg, ensure_ascii=False))
             except TypeError as e:
                 raise TypeError(
                     f"Arguments to event handlers must be Vars or JSON-serializable. Got {arg} of type {type(arg)}."

+ 0 - 8
pynecone/var.py

@@ -716,14 +716,6 @@ class BaseVar(Var, Base):
 
         return setter
 
-    def json(self) -> str:
-        """Convert the object to a json string.
-
-        Returns:
-            The object as a json string.
-        """
-        return self.__config__.json_dumps(self.dict())
-
 
 class ComputedVar(property, Var):
     """A field with computed getters."""