> Move the self.db line to the module level in sitePage
>
> db = DBPool.....
> Class sitePage(Page):
>   def writeContent(self):
>       conn = db.getConnection.....

Alternatively, you can also set db as a class variable, i.e. directly in the
class definition, not in the __init__ method. If you set db in the __init__
method, you will create a db object for every instance of sitePage, if you
set it as a class variable in the class definition, the same db object is
shared by all sitePage instances.

Class sitePage(Page):
  db = DBPool.....
  def writeContent(self):
    conn = self.db.getConnection.....

Note that you have to write self.db inside the class to refer to the db
object, instead of db only. All subclasses of sitePage will inherit the db
object automatically.

Christoph Zwerschke
Universität Heidelberg



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to