agreement and contradiction ...

> * Write your view, and if it needs to respond to XMLHttpRequests, have
> it serialize the response to XML or JSON. The tools in
> django.core.serializers make this extremely easy -- simplejson is
> bundled, so you can dump pretty much any Python data structure to
> JSON, and we provide serializers for converting Django model instances
> to JSON and/or XML.
> * Pick a JS toolkit (Dojo and YUI are my favorites) and write the
> front-end code to interact with your view(s).
>
> Really. That's all there is to it.

Agree. It´s really easy to do AJAX with Django (and ... I´m not a  
programmer at all).

>
> I've taken a lot of flak for this, but I have always maintained, and
> always will maintain, that this is just about all Django -- the
> framework -- should be doing. The only other thing I'd like to see,
> and we've already thrown around drafts of how it would work, is a "web
> services"-style API which would generically expose access to Django
> models for any sort of remote call, be it XMLHttpRequest or whatever.

I´d love to see that ...

>
> I've gone on at length in my blog about hte reasoning behind this, but
> it really comes down to just a few things:
>
> 1) There are plenty of really, really good JavaScript toolkits being
> given away for free right now, and I don't think Django should favor
> one or be opinionated about which one you should use; we should just
> make it as easy as possible for *any* of them to talk to a
> Django-powered backend.

Not so sure about this one. There are other good frameworks, but we  
choose Django to work with.
So what´s the advantage to favor a js-toolit?
1. It´s about certainty (which is not so important if you´re certain  
about your js-toolkit; I´ve been playing around with different  
toolkits for about half a year - and I´m still not sure which ones  
better for me ...)
2. Most important: It´s about sharing code, adopting solutions and  
making development faster.
3. Unless I´m very much mistaken, there´s already some development  
going on - in order to provide AJAX (Dojo) for the Admin-Interface.  
Since most of the django-users (I guess) will use the Admin- 
Interface, they probably won´t switch to another js-toolkit for their  
site ... well, at least I won´t.

>
> 2) Tools that try to "helpfully" generate JavaScript calls for you are
> brittle and may not save as much time as you think.
>
> 3) All too often, they're used not for their actual benefits, but
> because someone doesn't want to learn and/or write JavaScript. My
> personal opinion is that certain types of laziness are good to have in
> a developer (because they result in better, reusable, modular code),
> but that this is not one of them.

Again - I agree with 2) and 3)

patrick

>
> -- 
> "May the forces of evil become confused on the way to your house."
>   -- George Carlin
>
> >


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to