2006OCT041627
Simple
So I simplified it to show only what I entered today. To me, what matters most is whats I've entered today (for the moment at least).
Now there will be cases where I need to see what I've done in the past. The future involves a lot more work (and thinking) to be anything useful. So what's going on behind the scene?
Webpy
Well at the server side, the webpy code has to handle the following url patterns...
/rest/view/
/rest/view/2250
/rest/view/today
/rest/view/today/2250
Theres some docs on 'Request Handlers' using webpy. It's a bit thin but you get the idea of how to handle a path like /foo/bar/foobar in code ...
urls = ('/foo/(.*)', 'Foo')
class Foo:
GET = autodelegate('GET_')
def GET_bar(self):
"""do something with bar, ie: /foo/bar"""
pass
def GET_foobar(self):
"""do something with foobar, ie: /foo/foobar"""
pass
But I could not get the hang of something like /foo/bar/foobar.
[Expand on what I want to do]
MySql
The less sql I have in python code, the better. I could follow the advice of this article, Python Web Application Frameworks and use a db layer like PyDo or SQLObject but for the moment I'll create some views using MySql 5 syntax allowing me to simplify the queries.
One note. If you use MySQLdb try looking at DBUtils for connection pooling. I've had no end of problems with MySql database connections to the db not releasing, before installing DBUtils.
I found a few references to bugs in MySQLdb - something along the lines of being unable to release database connections. So it is worth the effort to try DBUtils.
Templating
Made some quick modifications to the Cheetah template.
[Expand on problems]
<<< start
2006OCT041627
Simple
So I simplified it to show only what I entered today. To me, what matters most is whats I've entered today (for the moment at least).
Now there will be cases where I need to see what I've done in the past. The future involves a lot more work (and thinking) to be anything useful. So what's going on behind the scene?
Webpy
Well at the server side, the webpy code has to handle the following url patterns...
/rest/view/
/rest/view/2250
/rest/view/today
/rest/view/today/2250
Theres some docs on 'Request Handlers' using webpy. It's a bit thin but you get the idea of how to handle a path like /foo/bar/foobar in code ...
urls = ('/foo/(.*)', 'Foo')
class Foo:
GET = autodelegate('GET_')
def GET_bar(self):
"""do something with bar, ie: /foo/bar"""
pass
def GET_foobar(self):
"""do something with foobar, ie: /foo/foobar"""
pass
But I could not get the hang of something like /foo/bar/foobar.
[Expand on what I want to do]
MySql
The less sql I have in python code, the better. I could follow the advice of this article, Python Web Application Frameworks and use a db layer like PyDo or SQLObject but for the moment I'll create some views using MySql 5 syntax allowing me to simplify the queries.
One note. If you use MySQLdb try looking at DBUtils for connection pooling. I've had no end of problems with MySql database connections to the db not releasing, before installing DBUtils.
I found a few references to bugs in MySQLdb - something along the lines of being unable to release database connections. So it is worth the effort to try DBUtils.
Templating
Made some quick modifications to the Cheetah template.
[Expand on problems]
<<< start