On Tuesday, December 23, 2014 3:49:07 AM UTC+1, James Schneider wrote: > > Have you looked at the Django REST Framework module? > Yes, I have. They wrote own serializers and fields for validation, and they don't use builtin forms. Personally I don't like DRF API, because it is too heavy and not following PEP20 (simple is better than complex), same as CBV in Django.
I wrote custom REST(-like) framework, independent from any framework but with bridge to Django. It's a little inspired by Cornice framework and I don't need (and don't want) to change it to Django REST Framework. In my handlers I was using Django forms to clean & validate data, but they failed. I though that I've found bug, but now I see that I need to replace clean & validation to something better (maybe Colander). > Django is primarily used for displaying/validating data received from HTML > forms > Now I know... I thought that Django is a generic web framework, but it isn't. It's a HTML-oriented web framework. > However, the internal behavior is decoupled enough > I disagree. It isn't decoupled enough for generic web framework: 1. Widgets are to close to fields (field.widget), and base Form class is using widgets directly in validation (field.widget.value_from_datadict calls in form`s methods). 2. Form._clean_fields() treats None value same as not existing key in input data - this is logical bug or improper simplification. But in the context of validation only HTML fields this is OK. Regards, Marcin -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/074812a3-f776-4092-894c-264c88858fd5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.