Looking for something lighter than Sproutcore or Cappuccino that integrates well with Django

72 views
Skip to first unread message

Rob Madole

unread,
Apr 8, 2009, 10:34:14 AM4/8/09
to Django users
I've been looking at a couple of RIA frameworks, namely Sproutcore and
Cappuccino. The feel a bit too heavy for me. Sproutcore does not
integrate well with Django. Cappuccino uses Objective-J as the
language and I'm not convinced this is a good choice for our team.

The reason I'm posting is to ask the community if they have know of
anything that is at a higher level than jQuery + jQuery UI and a lower
level than Sproutcore/Cappuccino. I'd like to find something that has
this kind of stuff in it:

- Client-side Javascript MVC implementation (Both Sproutcore and
Cappuccino have controllers and view)
- Easy layouts (I really like http://cappuccino.org/learn/tutorials/automatic-layout/)
- Data bindings (Step 4 on
http://www.sproutcore.com/documentation/hello-world-tutorial-2-your-first-viewsadsteste/)

So something less heavy, less "Desktop" feel; more Web 2.0 (Gmail,
Digg, Delicious). But more organization than a blank HTML and a
<script> tag that points to jQuery or Dojo or MooTools. (And yes, I
admit this is a bit of have-your-cake-and-eat-it-too).

Any links are appreciated.

Rob Madole

Scott Newman

unread,
Apr 8, 2009, 3:43:20 PM4/8/09
to Django users
> I've been looking at a couple of RIA frameworks, namely Sproutcore and
> Cappuccino.  The feel a bit too heavy for me.  Sproutcore does not
> integrate well with Django

> The reason I'm posting is to ask the community if they have know of
> anything that is at a higher level than jQuery + jQuery UI and a lower
> level than Sproutcore/Cappuccino.  I'd like to find something that has
> this kind of stuff in it:
> - Client-side Javascript MVC implementation (Both Sproutcore and
> Cappuccino have controllers and view)
> - Easy layouts (I really likehttp://cappuccino.org/learn/tutorials/automatic-layout/)
> - Data bindings (Step 4 onhttp://www.sproutcore.com/documentation/hello-world-tutorial-2-your-f...)

When I looked into some of the heavier JavaScript application
frameworks such as SproutCore, Cappucino, and ExtJS, the biggest
hurdle I faced was my own approach.

These frameworks are designed to build complete web applications, not
to be sprinkled within Django template files the way I might do with
jQuery. After talking with Erich from the SproutCore project, I
decided the best approach was to build the entire front-end
application in static HTML, CSS, and JavaScript, relying on ajax calls
to Django URLs for backend data. (I use Apache to serve my static HTML/
JS/CSS files and don't even process them with Django to save the
overhead)

Even with my jQuery projects, my initial results were a morass of
spaghetti code because I was approaching my client-side projects as a
web developer, relying on my experience with what I'd call "request
and response" thinking. I had to study the practices of traditional
stateful, event-driven desktop application development before my
attempts at these projects went more smoothly. (and I'm still
learning!)

If you settle on a client-side MVC framework, you'll probably want to
keep the frontend and backend completely separate and use Django for
web services calls to send and receive data to the frontend. The
client-side controllers will handle the data calls and binding to the
UI controls in the view. If instead you want a site that's mostly
driven by Django but has some extra functionality, I'd probably stick
with something lighter like jQuery.

I know this isn't the answer to your question, but since I've faced
the same issues, I thought I'd share. Hope this helps.

-- Scott

Raymond Cote

unread,
Apr 8, 2009, 5:19:12 PM4/8/09
to django...@googlegroups.com, robm...@gmail.com
Rob Madole wrote:
> The reason I'm posting is to ask the community if they have know of
> anything that is at a higher level than jQuery + jQuery UI and a lower
> level than Sproutcore/Cappuccino. I'd like to find something that has
> this kind of stuff in it:
>
From what I've seen, once you make that leap of higher than
JQuery/Dojo/Mootools/Prototype/etc. you really do leap into a fully
client-side environment like Cappuccino or Sproutcore and relegate your
Django-side to be JSON-RPC or XML-RPC server.

We've recently done the dance through a wide range of tools and ended up
selecting Qooxdoo (qooxdoo.org) for a variety of reasons.
Also pretty heavy on the UI side, though it has capabilities to be used
as a component on an otherwise static site.
(we're driving qooxdoo against Twisted, and not Django, but the same
principle applies).

Of course, if you want a Gmail feel, there's always GWT (or, since this
is a Python list, Pyjamas -- http://code.google.com/p/pyjamas/)
--Ray

Rob Madole

unread,
Apr 9, 2009, 1:13:06 PM4/9/09
to Django users
You did kinda answer the question. It's good to know that others are
going through this too. I was looking for confirmation that this was
actually a problem.

The spaghetti code, I definitely see that too. Because of the glob of
junk that you have to deal my projects end up being a lot of glue and
duct tape with a little bit of actual stuff in it.

Thanks for sharing.

lkcl

unread,
Apr 10, 2009, 5:05:29 PM4/10/09
to Django users


On Apr 8, 2:34 pm, Rob Madole <robmad...@gmail.com> wrote:
> I've been looking at a couple of RIA frameworks, namely Sproutcore and
> Cappuccino. The feel a bit too heavy for me. Sproutcore does not
> integrate well with Django. Cappuccino uses Objective-J as the
> language and I'm not convinced this is a good choice for our team.
>
> The reason I'm posting is to ask the community if they have know of
> anything that is at a higher level than jQuery + jQuery UI and a lower
> level than Sproutcore/Cappuccino.

well as raymond mentions, you _really_ should look at pyjamas http://pyjs.org
or if you want to cause yourself a headache because you don't like
python and prefer java - GWT.

> I'd like to find something that has
> this kind of stuff in it:
>
> - Client-side Javascript MVC implementation (Both Sproutcore and
> Cappuccino have controllers and view)

yep - i outline how pyjamas helps you keep at least the V and the C
on the client-side, in javascript, but you're still actually writing
python - in http://advogato.org/article/993.html

> - Easy layouts (I really likehttp://cappuccino.org/learn/tutorials/automatic-layout/)

err, that's not enough to understand what the heck is going on, but i
can guess

pyjamas allows you to still use CSS stylesheets, and still allows you
to call setWidth("80%") or "150px" etc. on widgets,

and, also, the "Table"-style panels such as pyjamas.ui.Grid have a
"CellFormatter" option which allows you to set the width and height
(in pixels, em or %, whatever) of individual cells.

FlexTable also allows you to set what "rowspan" and "colspan" of
individual cells.



> - Data bindings (Step 4 onhttp://www.sproutcore.com/documentation/hello-world-tutorial-2-your-f...)

i don't understand in the _slightest_ bit what that's about. but it
smells like it's substituting a widget into some HTML. if that's the
case, then pyjamas.ui.RootPanel() takes an optional string argument
which can be the "id" in the DOM model HTML, naming the element in the
HTML page that you want the widget to be attached to.

see http://pyjs.org/examples/dynamictable/ - DynaTable.py look for
this:

slot = RootPanel("calendar")

and then note that in public/DynaTable.html there is a <div
id="calendar">


> So something less heavy,

yep. pyjamas is about 9,000 lines - total.

> less "Desktop" feel;

well, that's up to you.

> more Web 2.0 (Gmail, Digg, Delicious).

yep. definitely.

> But more organization than a blank HTML and a
> <script> tag that points to jQuery or Dojo or MooTools.

yep. that too.

> (And yes, I
> admit this is a bit of have-your-cake-and-eat-it-too).

well, it's been done - big-time.

you also have the advantage that i quite like django, so have gone to
a lot of trouble to ensure that the django JSONRPC service actually
works, and i'm very-part-time doing a Django JSONRPC "Forms" hybrid
service, where you can merge a Django Form with a JSONRPC Service and
then use AJAX / JSONRPC in your client to interact with the Django
Form "validate", "save" and now, last week, i added "describe" which
will allow you to find out what the fields are of the form.

l.

lkcl

unread,
Apr 10, 2009, 5:19:30 PM4/10/09
to Django users


On Apr 8, 7:43 pm, Scott Newman <snewma...@gmail.com> wrote:
> > I've been looking at a couple of RIA frameworks, namely Sproutcore and
> > Cappuccino. The feel a bit too heavy for me. Sproutcore does not
> > integrate well with Django
> > The reason I'm posting is to ask the community if they have know of
> > anything that is at a higher level than jQuery + jQuery UI and a lower
> > level than Sproutcore/Cappuccino. I'd like to find something that has
> > this kind of stuff in it:
> > - Client-side Javascript MVC implementation (Both Sproutcore and
> > Cappuccino have controllers and view)
> > - Easy layouts (I really likehttp://cappuccino.org/learn/tutorials/automatic-layout/)
> > - Data bindings (Step 4 onhttp://www.sproutcore.com/documentation/hello-world-tutorial-2-your-f...)
>
> When I looked into some of the heavier JavaScript application
> frameworks such as SproutCore, Cappucino, and ExtJS, the biggest
> hurdle I faced was my own approach.
>
> These frameworks are designed to build complete web applications, not
> to be sprinkled within Django template files the way I might do with
> jQuery.

yes - that's a fact. pyjamas is no exception. although gwt-ext
proves that you can mix extjs into GWT, extjs itself is several tens
of thousands of lines of custom-written javascript; gwt-ext itself is
tens of thousands of lines of java - just the integration/startup in
gwt-ext to plumb extjs into gwt is eight _thousand_ lines of
javascript, on its own.

so you _can_ plug in "other JS frameworks" into pyjamas but you end up
thinking, "why in god's name am i spending so much time converting
some ridiculous javascript widget set framework which i'm never going
to fully understand, never going to be able to debug, never going to
be able to extend; why am i going to make myself wholly dependent on
that javascript framework, when i could be writing my own widgets, in
python, writing my own easily customisable, easily understandable
python framework that will be compiled to javascript to run in the web
browser??"

we have several people asking e.g. "i want prototype to be compatible
with pyjamas!" and i warn them, "don't do it - convert the app from
javascript to python / pyjamas and start from there".

it's a different, _much_ easier paradigm. imagine that python-gtk2
was available for running in _all_ web browsers - that's what it's
like, except the underlying widget set is far more flexible than
python-gtk2.


> Even with my jQuery projects, my initial results were a morass of
> spaghetti code because I was approaching my client-side projects as a
> web developer, relying on my experience with what I'd call "request
> and response" thinking. I had to study the practices of traditional
> stateful, event-driven desktop application development before my
> attempts at these projects went more smoothly. (and I'm still
> learning!)

yeah - the design of pyjamas is much more along the lines of event-
driven interaction that you'd expect of python-qt4 and python-gtk2
apps. you register for listening for click events with
"addClickListener()". you register for keyboard events with
"addKeyboardListener()". see http://pyjs.org/examples/helloworld/ for
an utterly simple example of this.

> If you settle on a client-side MVC framework, you'll probably want to
> keep the frontend and backend completely separate and use Django for
> web services calls to send and receive data to the frontend.

yep. that's the approach i take to every single project with
pyjamas, now - using JSONRPC it's just utterly trivial. you have to
work _really_ hard to make life difficult for yourself - mostly in the
form of getting over sheer disbelief that it should be much much
harder than it is. see http://pyjs.org/examples/jsonrpc/output/JSONRPCExample.html
don't use the python cgi-bin service, use the php one or install the
examples on your own system and set up cgi-bin execution.

l.


lkcl

unread,
Apr 10, 2009, 5:29:27 PM4/10/09
to Django users

> We've recently done the dance through a wide range of tools and ended up
> selecting Qooxdoo (qooxdoo.org) for a variety of reasons.

i'd love to be able to evaluate it, but i get this:

Error: unterminated string literal
Source File: http://demo.qooxdoo.org/current/demobrowser/script/demobrowser.js
Line: 7214, Column: 177
Source Code:
(function(){var m='<div style="',l='"></div>',k="mshtml",j='"/
>',i="",h='" style="vertical-
align:top;',g="scale",f="qx.client",e="qx.ui.decoration.Util",d='<img
src="',y=" src="',c="overflow:hidden;";

great! i'm impressed!

> Also pretty heavy on the UI side, though it has capabilities to be used
> as a component on an otherwise static site.

yehh, i did an integration of a pyjamas app with a joomla site -
http://worldfairtradeday09.org (see events listings and remember that
that's a live site, not a demo). so it's possible, but... yechh :)

regarding the use of qooxdoo:

* how do you anticipate being able to deal with situations where your
app evolves beyond what qooxdoo has to offer?

* does your application have to face a whopping great hit of the
entire qooxdoo libraries (extjs has a two MEGABYTE hit of javascript,
per page) even if you use a tiny proportion of its functionality?

* has your organisation got the time, skills, and resources, to fix or
improve qooxdoo if you encounter any bugs, flaws or missing features?

not being funny, or anything, but given a choice between under 10,000
lines of python (1500 of which is the python-to-javascript compiler)
and 50,000 lines of javascript, i know which one i'd pick, every time,
even if the widget set that the smaller project provided was more
"basic" than the "feature-rich" javascript framework/widget set.

l.

lkcl

unread,
Apr 10, 2009, 5:53:53 PM4/10/09
to Django users


On Apr 10, 9:29 pm, lkcl <luke.leigh...@googlemail.com> wrote:
> > We've recently done the dance through a wide range of tools and ended up
> > selecting Qooxdoo (qooxdoo.org) for a variety of reasons.

http://demo.qooxdoo.org/current/playground/#Calculator

ok - found one that works. and, actually, for a javascript
framework, the source code and readability is not bad - i can see why
you picked it. so - just for kicks i might write a calculator
example, for pyjamas, tomorrow. it won't take long.

so - yeah, imagine the functionality of qooxdoo, but you get to write
stuff in python, not javascript. all the ui widget classes are in
python, not javascript. that's pyjamas.

l.

zweb

unread,
May 10, 2009, 11:20:15 PM5/10/09
to Django users
Hi,

I am also looking at Qooxdoo. What has been your experience so far?

Will it integrate with Django templates and views?



On Apr 8, 2:19 pm, Raymond Cote <rgac...@AppropriateSolutions.com>
wrote:
> Rob Madole wrote:
> > The reason I'm posting is to ask the community if they have know of
> > anything that is at a higher level than jQuery + jQuery UI and a lower
> > level than Sproutcore/Cappuccino.  I'd like to find something that has
> > this kind of stuff in it:
>
>  From what I've seen, once you make that leap of higher than
> JQuery/Dojo/Mootools/Prototype/etc. you really do leap into a fully
> client-side environment like Cappuccino or Sproutcore and relegate your
> Django-side to be JSON-RPC or XML-RPC server.
>
> We've recently done the dance through a wide range of tools and ended up
> selectingQooxdoo(qooxdoo.org) for a variety of reasons.
> Also pretty heavy on the UI side, though it has capabilities to be used
> as a component on an otherwise static site.
> (we're drivingqooxdooagainst Twisted, and not Django, but the same
Reply all
Reply to author
Forward
0 new messages