On Wed, 2009-08-12 at 11:47 +0300, Jani Tiainen wrote:
> HB kirjoitti:
> > Hey,
> > Why Django doesn't provide integration with Ajax out of the box (like
> > Rails and Wicket)?
> 
> It all depends what you mean by "integration"?
> 
> You can use (model)forms with Ajax, or use any other means if you wish.
> 
> Only thing that django doesn't provide is Ajax form rendering - I mean 
> that you can't just say {{ form }} and magically get ajaxafied form.

I'll reply here, rather than against the original post, since you're hit
the nail on the head, but I want to expand somewhat...

We have always encouraged people to come up with a good set of template
tags to do this sort of stuff. Right now, there doesn't appear to be
anything that looks very Django-like. If you look at the Ajax helpers in
Rails, for example, it's like writing Ruby in the templates. Since
Django deliberately strives to have very simple templates, without
programming in the templates, the challenge is greater for "generic"
template tags.

This doesn't mean it's harder to use Ajax, it just means that people are
more likely to write custom template tags that insert the precise Ajax
bits they're after. Including Ajax or other Javascript bits in Django
templates isn't hard and writing custom tags is very easy, so it seems
that the middle ground we've arrived at is reasonably acceptable to our
core audience (experienced Python developers and web designers).

It also doesn't mean that people shouldn't continue to try and create
the perfect set of Ajax tags. When that happens, it will attract
attention, fame, fortune, etc, and after suitable shaking out, we would
look at whether it's worthwhile including in contrib. But in the 4+
years that Django has been open sourced, nobody has yet done that, which
shows where the balance between need and pragmatism lies.

> And there is good reason - what would be javascript framework to use 
> then? MooTools? jQuery? Prototype? ExtJS? Or my favourite Dojotoolkit (I 
> bet there is dozen of others that I don't remember or are aware of)

That is also definitely a consideration.

Along those lines, there are some library specific helpers that have
been created. Search for dojango, for example, a set of Dojo-based
Django template tags. I'm not sure if they're particularly good or not,
as I haven't used them much at all, but they exist, which is definitely
a good thing. There's also YUI-based incremental loading via Django
template tags out there, too, which was even featured on the YUI
developers blog (as an example of YUI-in-action) at one point.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to