[Zope] product organization

Nicholas Wieland nicholas_wieland at yahoo.it
Thu Jul 28 08:50:43 EDT 2005


But how do I get the connection id ?
Actually I get it when I instance the product in Zope.
What I think is something like
 
class Foo
 
  def __init__ (self, conn):
    self.conn = conn
 
  myquery = SQL ('doMyQuery', '', self.conn, '', 'select * from table')
 
but obviously it will not work.
 
TIA,
  ngw
 
p.s. Sorry for top-posting

Marco Bizzarri <m.bizzarri at icube.it> ha scritto: 
I can't talk for best practise. You can put your queries also outside of
the init, in this way:

class YourProduct:

_my_query = SQL('doMyQuery', '',
'your_connection', '', 'select * from data')

def __init__(self):
pass


Also, if you have a *LOT* of queries, consider in building your query on
the fly.


		
---------------------------------
Yahoo! Mail: gratis 1GB per i messaggi, antispam, antivirus, POP3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20050728/88008970/attachment.htm


More information about the Zope mailing list