Hacker News new | past | comments | ask | show | jobs | submit login

I've been working on something pretty similar, but on the server side. It's called 'Neurons', and it's a pre-alpha Python library. It's built on Spyne[3], an RPC framework which is another side project of mine that I've been working on for ~4 years now.

The aim with neurons initially is to let you generate a html form (e.g. [1]) and related services from just a model definition and an instance of this model (e.g. [2]), making it a breeze to publish CRUD pages. It currently handles complex stuff like dates, times, arrays and nested objects just fine.

In Spyne terms, that's "serializing a model instance using the HtmlForm protocol". The same object definition can be used to for other protocols like json as well as for persisting data to a relational database (via SQLAlchemy). You can play with the code generator at http://spyne.io to get a better feel about how it works.

One could even write a Spyne protocol that renders a given model instance to way.js code.

Help is welcome!

[1]: https://github.com/plq/neurons/blob/test_output/html/test_si...

[2]: https://github.com/plq/neurons/blob/fccab8fee4c1795f65ac3f9b...

[3]: http://spyne.io




Oh man, I've had to work on projects with serverside form generation (python people are really into this stuff for some reason), and it's a huge pain. Backend engineer thinks it's going to be way easier or something not having to write templates, however on the frontend, the code generated by these tools is always weird and different from the rest of the markup. No thanks.


FWIW, with neurons, there's always the option to override markup generation on a field-by-field basis, so if you don't like the generated code for a certain part of the document, you can change it to your heart's content.

You'll even be able to pass templates down a certain object hierarchy, but that's further down the pipeline.


Same. Not sure why this is such a popular thing to do. Makes error handling almost impossible to reason about.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: