Hacker News new | ask | show | jobs
by sgt 1055 days ago
My first thought when seeing their validation examples - when I build a Django app and add validations, I start off with a normal form that does a full submit. This is the easiest to get going. As requirements become a bit more complex, I might add JS validation so that a POST is not necessary. Looking at their validation examples:

https://www.django-unicorn.com/examples/validation

This does a POST each time, albeit automatically on typing. It still means a lag for a kind of validation that could have been done client side.

1 comments

> This does a POST each time, albeit automatically on typing. It still means a lag for a kind of validation that could have been done client side.

If you can accept that lag, the tradeoff is that you only have to write the validation logic once, in one language. Furthermore, if your validation includes something like "check that this username isn't already registered" that requires server-side logic, you're stuck with that POST request and lag anyway.

Agreed. Rather maybe spend time on your UX and ensure that the form is understandable by the user. And by deploying closer to the edge, the latency should be pretty low.