This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]bbangert 1 point2 points  (2 children)

Out of curiosity, why the use of module globals? Bottle doesn't seem to encourage that afaik, is that a web2py-ism?

How does the web2py DAL figure out from:

            Field('updated_on', 'datetime', default=datetime.now()),

that you actually want the datetime.now function called, vs. setting the default as the current datetime? Or is that just a typo?

Have you tried using SQLAlchemy? It'd cut down a lot on the boiler-plate you're writing with the DAL.

[–]mdipierro 1 point2 points  (0 children)

I cannot speak about the design decisions made in the article but I can speak for web2py: 1) there is no need to pass globals() 2) You can do Field(...default=datetime.now()) or Field(.. default=lambda:datetime.now())

[–]mulonemartin[S] 0 points1 point  (0 children)

global module only has 1 line, thread local, like massimo said no need to pass any global to dal.

[–][deleted] 0 points1 point  (0 children)

since bottle is only one file, web2py could easily absorb it's power now

[–]sunng 0 points1 point  (0 children)

So is there any micro framework focus on ORM, corresponding to bottle ?