I love both Django and the Google Web Toolkit. Who else thinks tighter integration would be nice?

239 views
Skip to first unread message

adambossy

unread,
Dec 16, 2008, 1:51:51 PM12/16/08
to Django users
I am a staunch advocate of the unconventional Google Web Toolkit (GWT)
as a framework for dynamic Web application development. I also use
Django, of course. In my current project, much of my time has been
wasted devising how to transfer content to and from Django and GWT.

The root of my problem is that I am trying to maintain synchronization
between my Django ModelForm and what GWT is displaying. Being an
idealist, I hate coding the same thing in two different places when it
should be written once. I should be able to define a ModelForm and
have GWT read it. This isn't a severe problem at the moment, but I
imagine it will be as my project grows and becomes more complex.

It seems that to adequately address my problem, I would have to write
classes to substantially mimic those of ModelForm, BoundField, etc. I
would also have to create some process to serialize them properly in
Django. By extension, a lot of Django's functionality could be
extended into GWT for tighter integration. Based on the silence of
Stack Overflow, this is territory that has yet to be treaded on:
http://stackoverflow.com/questions/369230/what-is-the-best-way-to-serialize-a-modelform-object-in-django

My question to Django users is, would you find such code to be useful
for this specific AJAX framework? What specific functionalities would
you seek to be integrated? Forms, or something else?




Ian Lawrence

unread,
Dec 16, 2008, 2:31:07 PM12/16/08
to django...@googlegroups.com
Hi
look at http://autotest.kernel.org/
this is a djand and gwt application used for kernel testing. It basically sets up an RPC django server which passes json into gwt.
It is a great app to learn how this all works

Ian

--
http://ianlawrence.info

adambossy

unread,
Dec 16, 2008, 4:50:11 PM12/16/08
to Django users
Thank you! I'll look into it. I would have never found this on my own.


On Dec 16, 11:31 am, "Ian Lawrence" <irlawre...@googlemail.com> wrote:
> Hi
> look athttp://autotest.kernel.org/

Gavin McQuillan

unread,
Dec 17, 2008, 9:44:48 PM12/17/08
to django...@googlegroups.com
If you're interested in an all-python implementation, there's a project to fork the functionality of GWT called pyjamas: http://code.google.com/p/pyjamas/

Cheers,
-Gavin

lkcl

unread,
Mar 29, 2009, 7:06:31 AM3/29/09
to Django users, adam...@gmail.com
sorry about re-beginning this thread but googlegroups decided to
"close" responses. i accidentally replied privately to adam as a
result, and will endeavour to reproduce what i wrote.

as mentioned previously here on django-users, here is the beginnings
of achieving exactly what adam is referring to - tighter integration
between django and GWT:

http://pyjamas.svn.sourceforge.net/viewvc/pyjamas/trunk/pyjs/jsonrpc/django/jsonrpc.py?view=markup

as you can see it is a combination of Django Forms with a JSONRPC
service. i've added the "save" command (untested) to demonstrate the
point.

what needs to be added to make this useful is a "describe" command.
the "describe" command must return a description of all fields, along
with default values, sizes, lengths, types, multi-values, and
basically absolutely everything that's needed so that a GWT or Pyjamas
app can dynamically create a complete form widget at the client /
browser end.

the creation can be done by a generic class in much the same way that
as_table() works - and so it will need EXACTLY the same full set of
information.

l.
Reply all
Reply to author
Forward
0 new messages