|
|
|
|
|
by fuhrysteve
3739 days ago
|
|
I'm a little horrified to suggest this seriously, but this could be a cool way to accomplish consistent field validation between server and client. I wrote this little library https://github.com/fuhrysteve/marshmallow-jsonschema#complet...
to convert marshmallow schemas to a JSON representation with the intention of passing it to a browser or mobile device for rendering. Imagine if you could also pass native code to be used by the client for validation. In other words: write your validator in python and use it server side - but also convert it to javascript so that the client can attempt to validate it before bothering to send a web request. |
|
Having a "HOT" interpreter with an execution context that is persistent and can be used to convert code to ES5 on the fly has been already implemented by duckpy creator and i plan to intergate it very soon.
See https://github.com/amol-/dukpy/issues/4