Re: [SQLObject] The latest SVN checkout.
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Peter G. <pe...@fs...> - 2004-02-07 00:54:34
|
> Basically, the SQLObject package becomes sqlobject, and SQLObject.py > becomes main.py. .new() becomes __init__() (i.e., class instantiation > creates a row), and you use .get() to retrieve an already-existant row. Thank's for clearing that up. > That sounds good to me. I don't know the overhead of sending a logging > message when no one is paying attention, so I don't know if it's worth Me niether. Since it only logs through a level "filter" it should be one method call and one int equality test at the most even if there is nothing to actualy log. At any rate, even if you log every database event the bottleneck wouldn't be streaming a ~50 character string to a file or console, I think the actual communication with the database will remain the actual bottleneck. Especially if you are not communicating with a local database. > it to keep the connection debug attribute. There's a good chance it > doesn't matter. The debug argument should stay, though, because that's > an easy way to control output, and it could just configure the logger to > print output to stdout. > > I believe the logging package also introduces the concept of a hierarchy > of loggers. So there could be, say, a general sqlobject logger, and > per-connection loggers. Or the connection logger could be a settable > attribute. Or there could be a general logger, and a SQL logger that > logged all communication to the database. I don't really have much > experience to draw upon using that module. Right now I can follow every connection-related matter through the logs. Stuff like object instansiation is not included, I think that's a waste of log. The interresting thing is the database communication and that's being logged well enough. I haven't put a lot of time to it yet, so it wouldn't be a tremendous loss of work if you choose to discard it. The logger is passed as a named argument to the connection constructor at instansiation time. I'm rewriting the examples to work with a logger too, I could rewrite them to work with the new 0.6 SQLObject design while I'm at it. /Peter |