Some interesting thoughts here. I once attempted to make a merge between Django validation and jQuery validation (spent several weeks on it), but my approach wasn't dynamic enough, and ended up not being used again.
Personally, I'd like to see some sort of standardized JS library which works seamlessly with Django form validation, but it is an absolute PITA. Cal On Tue, Jul 12, 2011 at 4:42 PM, Andre Terra <andrete...@gmail.com> wrote: > May I ask if you are managing to do this (and, if so, how) without >> writing duplicate logic? >> > > This, to me, is a key area for improvement. Aside from the development > challenge the idea imposes, an extra issue with writing DRY validation for > django and javascript is that the project doesn't officially endorse any > javascript library (there's been extensive discussion about this), but > nobody says it's not okay to write an app that uses jQuery, for example. > > My issue with uni-form and the like is that these apps get hard to extend > once you find a fringe-case for your app. I tried using it once and soon > enough I was writing so much custom code that I decided to drop uni-form > altogether. > > The issue of form validation being complex has also been discussed on > django-developers, and I don't mind to be rude, but this kind of "wouldn't > it be nice" discussions usually end in some core developer saying "go ahead > and show us some code, then we can think about merging it into django". > Django has an extensive to-do list (we're only at version 1.4!) and Keith is > usually the first to say that unless there's code to go along with the > proposal, there's not a lot they can do about it. > > History shows good ideas *do *get implemented, and Alex Gaynor is, imho, > the developer to look at for examples on how to write quality django apps > (for instance, take a look at https://github.com/alex/django-filter/ > <https://github.com/alex/django-filter/%20>which is pretty small, but very > django-like, even though he's not really proud of the API for that app in > particular). > > > If any of you take a step into writing a better API for form validation, > I'm sure the core devs will be more than excited to take a look at, > considering how the current implementation is still obscure in some steps > (or lacking sugar), e.g. self._errors["subject"] = self.error_class([msg]) > > But first one needs to decide if he's cleaning up django's API (hard) or > writing integrated js-python validation (harder). > > > Cheers, > André Terra > > > > On Tue, Jul 12, 2011 at 12:08 PM, Derek <gamesb...@gmail.com> wrote: > >> >> On Jul 12, 10:15 am, Venkatraman S <venka...@gmail.com> wrote: >> > On Tue, Jul 12, 2011 at 1:23 PM, Cal Leeming [Simplicity Media Ltd] < >> > >> > >> > cal.leem...@simplicitymedialtd.co.uk> wrote: >> > > On 12 Jul 2011 08:13, "bruno desthuilliers" < >> bruno.desthuilli...@gmail.com> >> > > wrote: >> > >> > > > On Jul 12, 3:37 am, Venkatraman S <venka...@gmail.com> wrote: >> > >> > > > > On the validation, yes, it is a little pesky. But, offlate, i am >> trying >> > > to >> > > > > *understand* it better and trying to move the logic >> > > > > to the client. For eg. jquery-validate does bulk of the stuff on >> client >> > > side >> > > > > - atleast for required fields. So, moving >> > > > > bulk of the validation to the client helps in avoiding a few http >> > > calls. >> > >> > > > Client-side validation may be fine from a UX POV, but you just CAN >> NOT >> > > > rely on it - I mean, unless you're happy with unvalidated user >> > > > inputs.... >> > >> > > +1 >> > >> > True; the validation *should* be present in the server, but i am trying >> to >> > move the *same* >> > validation(as much as possible) to the client *too*, so that the http >> calls >> > be avoided. >> >> May I ask if you are managing to do this (and, if so, how) without >> writing duplicate logic? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To post to this group, send email to django-users@googlegroups.com. >> To unsubscribe from this group, send email to >> django-users+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.