Some Code

9 views
Skip to first unread message

limscoder

unread,
Aug 30, 2010, 2:22:06 PM8/30/10
to dojango-users
Hi,

I am using Django and Dojo together, and I came across this project.
However, I don't like littering my markup with Dojo attributes, so I
wrote my own Dojo app that allows you to create form widgets
programatically. It takes a slightly different approach than Dojango
(uses an object attached to the request by middleware to manage Dojo
properties). I was wondering if you'd be open to integrating some of
the code into the Dojango project. You can get details and code here:
http://limscoder.blogspot.com/2010/04/django-dojo.html

Let me know what you think.

-Dave

klipstein

unread,
Aug 30, 2010, 3:18:55 PM8/30/10
to dojango-users
Hi Dave,

awesome work on your shortened Dojo integration. Definitely more
lightweight than my work :) Don't know why I never had the idea to use
the request for storing Dojo properties. Maybe just because the
middleware django.core.context_processors.request has to be added and
because i wanted to have a complete form abstraction that is usable
exactly as the normal django forms, so a django developer does not
have to learn a new logic. And in my case there are several areas
where it is not possible to pass the request to the form.

Also I never cared about extra (non-valid) attributes in the HTML,
because I knew that someone will either write a validation for that or
the "data"-attributes will be used in the future, which happened in
Dojo trunk lately: http://bugs.dojotoolkit.org/changeset/22697.
Dojango would need some love to use those new attributes.

By having a short look onto your code I've recognized that an
integration wouldn't be easy, but I would love to have a programmatic
instantiation within dojango. There is already the DojoCollector that
just cares about the dojo.require calls atm, but also could be
faciliated to save form field attributes and to generate the dynamic
js code for instantiation. Would be great, if you would like to work
on that?

Regards, Tobias

limscoder

unread,
Aug 31, 2010, 1:22:50 PM8/31/10
to dojango-users
I'll take a look at the code when I get a chance and see what I can
do.

On Aug 30, 12:18 pm, klipstein <tobias.klipst...@googlemail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages