[Chicago] web2py 1.20 is out

Massimo Di Pierro mdipierro at cs.depaul.edu
Tue Feb 5 06:36:15 CET 2008


Doing JSON in web2py is not much more difficult. Here is example 11 from
http://mdp.cti.depaul.edu/examples/default/examples

def makejson(): ### this is a samle controller
     import gluon.contrib.simplejson as sj
     return sj.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])

Here is example 14 with ajax+wiki effects (complete code):

from gluon.contrib.markdown import WIKI
def ajaxwiki_onclick(): return WIKI(request.vars.text).xml()
def ajaxwiki():
     form=FORM(TEXTAREA(_id='text'),INPUT 
(_type='button',_value='markdown',
                  _onclick="ajax('ajaxwiki_onclick',['text'],'html')"))
     return dict(form=form,html=DIV(_id='html'))

Massimo

On Feb 4, 2008, at 11:26 PM, Feihong Hsu wrote:

> There is no right framework for every need. I do get the feeling that
> maybe what you are looking for is a "full-stack" framework like
> TurboGears. Of the various Python web frameworks, TurboGears comes
> closest to addressing everything from backend to frontend. Google
> around for a screencast that shows how to use TurboGears in
> conjunction with Adobe Flex. Unfortunately, there isn't any special
> integration between the two, it's just the two frameworks
> communicating via JSON. However, adding JSON support for a controller
> method in TurboGears is super trivial (just put @expose("json") on
> top of the method).
>
> Personally, I think that every Python web programmer should try
> making their own web framework. Not because it's a "cool" thing to
> do, but because it helps you understand the design decisions. With
> this knowledge you are better prepared to evaluate the tradeoffs that
> each framework makes. And really, it's not so hard to build your
> framework, if you start off from something like Paste (which is like
> a framework for making frameworks). I should mention that the cool
> web-based debugger in Pylons actually comes from Paste, and you can
> use it in any framework built on top of Paste.
>
> I made a crappy framework a long time ago, but after doing some
> programming in Django and Pylons, I feel ready to start working on my
> second one. I'm not even going to bother with an ORM, I'm just going
> to use CouchDB for the database ;-)
>
>
> --- Daniel Griffin <dgriff1 at gmail.com> wrote:
>
>> I am also confused. There seems to be 2 types of framework, the
>> opinionated
>> holier than thou kind(Ruby on Rails, Django) and the super
>> flexible,
>> everything to everybody kind like Pylons.
>>
>> The one thing I dont really understand is constantly re-writing
>> pieces like
>> ORM or template languages. I have been using Pylons(with varying
>> success)
>> which leans slightly towards SQLAlchemy and Mako, but will also
>> work with
>> SQLObject, DBapi, Kid, Myghty and a slew of other things, which is
>> nice but
>> also very confusing since the documentation is rough and packed
>> with side
>> notes. I would really like Prof. Di Pierro's input on this and why
>> he went
>> the way he did with web2py.
>>
>> I still havent found a framework that is easy to use for me, namely
>> flexible
>> ORM(support for multiple databases, composite keys) and easy
>> presentation
>> using Ext, Prototype etc. Pylons really falls down when it comes to
>> presentation, I want quick and easy forms and Pylons hasnt really
>> delivered.
>>
>> I have been trying to solve a much larger problem than any of these
>> frameworks really prepares me for, namely working with creating a
>> web
>> front-end to a mature piece of enterprise software. Pylons has
>> given me the
>> most hope so far, but I think I am still going to end up writing a
>> ton of
>> boilerplate code.
>>
>> Sorry if this is a bit of a rant and I dont mean to be rude to
>> Prof. Di
>> Pierro, I am just struggling to figure out which way is the right
>> way.
>>
>> Dan
>>
>>
>> On Feb 4, 2008 9:07 PM, Jon Sudlow <jsudlow at gmail.com> wrote:
>>
>>> With all these frameworks out, which one should you use. I'm
>> swamped with
>>> Django, Ruby on Rails, Turbo Gears, Zope/Plone, when does it
>> end???
>>>
>>> Does anyone have any suggestions or experience to argue one
>> framework over
>>> another?
>>>
>>>
>>> On Feb 4, 2008 8:27 PM, Massimo Di Pierro
>> <mdipierro at cs.depaul.edu> wrote:
>>>
>>>> web2py 1.20 is out.
>>>>
>>>>       www.web2py.com
>>>>
>>>> New features include the inclusion of a web based testing
>> framework -
>>>> a screenshot is here:
>>>>
>>>>       http://web2py.googlegroups.com/web/test.tiff
>>>>
>>>> pyamf howto, rest support, handler for lighttpd/fcgi, WIKI
>> helper,
>>>> etc. AND it is always backward compatible.
>>>>
>>>> The source code is also on
>>>>
>>>>      code.google.com/p/web2py
>>>>
>>>> Here are a dozen of ready made applications which you can
>> install
>>>> from the web interface.
>>>>
>>>>     http://mdp.cti.depaul.edu/appliances
>>>>
>>>> Massimo
>>>> _______________________________________________
>>>> Chicago mailing list
>>>> Chicago at python.org
>>>> http://mail.python.org/mailman/listinfo/chicago
>>>>
>>>
>>>
>>>
>>> --
>>> Jon Sudlow
>>> 3225 Foster Avenue
>>> 221 Sohlberg Hall
>>> C.P.O 2224
>>> Chicago, Il  60625
>>> _______________________________________________
>>> Chicago mailing list
>>> Chicago at python.org
>>> http://mail.python.org/mailman/listinfo/chicago
>>>
>>>
>>> _______________________________________________
>> Chicago mailing list
>> Chicago at python.org
>> http://mail.python.org/mailman/listinfo/chicago
>>
>
>
>
>        
> ______________________________________________________________________ 
> ______________
> Never miss a thing.  Make Yahoo your home page.
> http://www.yahoo.com/r/hs
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/chicago/attachments/20080204/cac5497b/attachment-0001.htm 


More information about the Chicago mailing list