Archives for the ‘Tips’ Category

Stupid Google App Engine

Is there a huge difference between ‘string’ and ‘text’? Why database can be indexed by string but not text? Stupid.

A simple buildbot buildsavle for STAF/STAX

In order to integrate STAF with buildbot, you need a function that parses the result. One odd thing is it doesn’t matter how many test cases fail in a STAX task, it always shows “NORMAL” in STAF result as long as the syntax is okay. So the failed test case number is only thing that [...]

web2py在Google App Engine的部署(续)

上次谈过一次在GAE部署web2py程序,但是真正实践起来没有那么容易。今天试着把自己的一个web2py应用部署了一下,讲讲一些经验,给大家分享一下: 1. web2py包里自带一个app.yaml,一般情况下好像可以直接用。我也懒,没研究。只把application改成了自己的名字,然后就用sdk部署到GAE了。 2. 数据库操作时一定注意有几个不支持,如果你的程序里用了到时候就会出错. 参考:http://www.web2py.com/AlterEgo/default/show/138 比如在查询数据库时使用OR (“|”) not操作(“!=” 和 “~”) LIKE (“like”操作)和IN (操作符”belongs”) 我就犯了这个问题,有个AJAX操作用了like,像是db.members.name.like(pattern)在GAE上是不能用的。 还有其他比较离谱的 mix queries by id and queries by other fields like in (db.image.id==id)&(db.image.title==”) 居然这个也不行 3. 数据库从本地迁到GAE要配置bulker,但是我还没有搞懂,用了一个笨办法,直接写了一个页面把本地csv导到GAE数据库,但是有个问题好像就是GAE每个表最多只能有1000条数据?我得想个办法搞几个表,不过到时候查询的时候就麻烦些了。 希望能对web2py玩家有点帮助。