Thanks!
Jon Brisibn
http://jbrisbin.com
--
Sylvain Thénault LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian: http://www.logilab.fr/formations
Développement logiciel sur mesure: http://www.logilab.fr/services
Python et calcul scientifique: http://www.logilab.fr/science
http://code.google.com/p/play-py/
/Johan Carlsson
--
Johan Carlsson
Colliberty Easy Publisher
http://www.easypublisher.com
actually we didn't removed it, we simply stop using it. It's based on
SimpleTAL which is a pure python module so it should be usable within
appengine very quickly. Having support for the django template language
(or any other with pure python implementation, there are tons of them)
would probably be worth half a day of work though.
Hi Jonathan! Pylons runs on App Engine, and some of us are currently
testing it to find any edge cases it has in the App Engine
environment. Mako runs on App Engine, and Beaker has a Datastore
backend for storing sessions. I think Genshi and Jinja run on it now.
There are three main issues with App Engine, which affect any large
framework or application: the query restrictions, the 1000-file
limit, and the missing functions from the Python standard library.
The appengine-monkey package provides stubs for the missing functions,
which was necessary to get Setuptools and several template engines to
run on App Engine at all. The App Engine developers has belatedly
acknowledged that some of the missing functions are necessary
(especially the ast module), so hopefully we won't need the
monkeypatch someday, but they haven't said when.
Webapp is well thought-out and more flexible than it appears, but
you've got to provide a lot of stuff yourself: MVC structure, forms &
validation, etc. Having used (and liked) Quixote for a couple years,
I got tired of reinventing the wheel on the extras and not having a
standard or at least a few choices tested by my colleagues to go by.
But if you like minimal frameworks, Webapp is a pretty good choice.
My main problems with it:
- self.redirect() and self.error() do not raise exceptions to jump
immediately out of the handler, so you have to put if's around all the
following code, including anything that calls the function that did
the redirect/error.
- self.response is not WebOb even though self.request is.
- webapp.template is a kludgy extraction of Django templates
according to the docstring; it has to emulate global variables to use
it. It works but it makes me uncomfortable.
I like Pylons because it's pure WSGI from the ground up and designed
for interoperability, so it fits well with the App Engine paradigm and
with any third-party components you want now or may want in the
future. Plus the same application can theoretically run on App
Engine, another cloud server, or a traditional webhost. Well, that's
true for other frameworks too. I'm not sure how feasible it is to
make a portable app given the Datastore-centric nature of App Engine,
but that will come out with further research, and as we see what other
cloud companies offer to compete with App Engine. Anyway, my opinion
is Pylons is the most flexible non-minimal framework currently
available.
App Engine offers a subset of Django, and Guido seems to favor Django.
Probably most App Engine apps are being written with Django
currently. But it's still the very early days. To me it's not an
issue of which framework has the biggest market share but having
choices available. At least one monolithic framework (Django), a
mix-and-match framework (Pylons), and a minimalistic framework (Webapp
; maybe web.py) should be available.
I haven't had a chance to look at LAX but it may end up having its own
niche: a non-minimal framework built for App Engine. That may raise
issues if you later want to port your App Engine app elsewhere, but
maybe LAX will address that issue. The database layer from what I've
read provides more relational-like features. My first questions about
it are: is it reliable, and is the API too brand-new to be trusted?
Is it trying to do too much relational-like stuff that's ultimately
futile on BigTable? It may be perfectly reliable and robust in all
these regards; I just haven't had time to evaluate it for myself. But
these are the questions I would have in mind.
--
Mike Orr <slugg...@gmail.com>
just to clafiry:
* LAX is the GAE version of our framework that we've been using
internally and for our customers for the past 5 years, it has not
been built specificly for GAE. We've just decided to take the
opportunity of the outcoming of GAE to release part of this
framework as free software. So the api is not really brand-new ;)
* we'll probably release in a near future the RDBMS backend so one can
write applications running on top the a relational database or on GAE
without changing one line of code (thanks to the RQL implementation
for the datastore)
* the RQL language has evolved in the past years, and is now a fully
featured language. The SQL implementation has been heavily used and
tested and is very robust and mostly bug free. Of course the datastore
implementation is more young, not complete and will be improved as
time goes, though this is already a good start much more powerful than
gql and all, and we're now writting real world applications to test
its effectivness.
> I'm an architecture nazi that favors loosely coupled systems and I'll
> be the first one to respond to the battle cry of "don't combine
> application logic and presentation". But I'm also a pragmatist and
> have seen how productive a collaborative session can be when a
> framework assert itself between the developer and the customer.
> Personally I think it's overzealous of the Django group to enforce
> this restriction and a more palatable solution would have been to
> provide some kind of flag that can be set at runtime that permits the
> devilish behaviors I'm advocating (introducing some basic python logic
> and looping into template rendering).
It's an age-old controversy, how much computational logic to allow in
templates. On a scale of 1-10 they look something like this:
0 - No logic allowed, only $placeholders and block begin/end
markers. The caller can manipulate
blocks to mimic 'if' and 'for'. The oldest PHP template system did this.
3 - Django: if/for/def allowed, but not expressions.
(Django-templates also has an extensive set
of built-in functions and an extension interface, which partly
make up for the lack of Python
code.)
5 - Genshi: if/for/def and Python expressions allowed, but not Python
statements.
8 - Mako: if/for/def, expressions, and arbitrary Python code allowed.
10 - All logic allowed: PHP is like this because the entire language
is embedded in HTML.
The second question to ask is, why are these engines that way? The
all-logic school wants to enable everything you might need because the
engine developers can't anticipate every situation. The no-logic
school believes that mixing logic and presentation is evil, and
envisions a dedicated
HTML designer distinct from the programmer. As time goes on more and
more functions are needed, which are implemented with a special syntax
to keep them "easier" or "different" than the underlying programming
language.
But the third question is, are these theories really true? Is it
right to judge programming logic based on the language it's written
in? (special template syntax = good, Python = maybe bad). Is a
certain preapproved construct better than an arbitrary one? Or does
the purpose of the logic matter more than the language or specific
construct? A growing number of Python template developers think it
does. The issue is to separate UI-related code from model/business
code, not to bless certain language constructs.
However, Python MVC frameworks have not quite evolved to the point of
having a Python view layer distinct from the Python controller layer
(i.e., a view method distinct from both the controller method and the
template). Still, you can do something similar in Mako/Cheetah by
putting the view code in the template or in a "Python template module"
used by the template. But even with that sometimes you put "view
logic" in the controller because it's just so computational you want
it in a normal Python method. E.g., preparing options for a select,
or data for table cells. I wonder if a controller action that calls a
"view action" that invokes the template might be a pattern worth
exploring.
--
Mike Orr <slugg...@gmail.com>