[Zope] Zope Recordset Object
Hello, I have a ZSQL Method, which is called by my python script. However, I am curious as to what type of object is returned when that call is made. It's some sort of a recordset (or resultset) object that behaves like a list...it doesn't seem to be a dictionary object though, but I can't find any object reference on it. I tried using rs.keys() but it says that method doesn't exist in that class. Does anyone have a member function list (object reference ) that's associated with this resultset or can tell me what kind of object is returned? I gave up on google, couldn't find anything on it. Thank you in advance! __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope Recordset Object
+---[ Alric Aneron ]-- | Hello, | I have a ZSQL Method, which is called by my python | script. | However, I am curious as to what type of object is | returned when that call is made. | It's some sort of a recordset (or resultset) object | that behaves like a list...it doesn't seem to be a | dictionary object though, but I can't find any object | reference on it. I tried using rs.keys() but it says | that method doesn't exist in that class. | Does anyone have a member function list (object | reference ) that's associated with this resultset or | can tell me what kind of object is returned? | I gave up on google, couldn't find anything on it. It's a 'Result' class; looking ${ZOPE}/lib/python/Shared/DC/ZRDB/Results.py Quickly; .dictionaries() will return it as a list of dicts .names() will return the field list -- Andrew Milton [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope Recordset Object
- Original Message - From: Alric Aneron [EMAIL PROTECTED] To: zope@zope.org Sent: Friday, June 16, 2006 10:19 AM Subject: [Zope] Zope Recordset Object Hello, I have a ZSQL Method, which is called by my python script. However, I am curious as to what type of object is returned when that call is made. It's some sort of a recordset (or resultset) object that behaves like a list...it doesn't seem to be a dictionary object though, but I can't find any object reference on it. I tried using rs.keys() but it says that method doesn't exist in that class. Does anyone have a member function list (object reference ) that's associated with this resultset or can tell me what kind of object is returned? I gave up on google, couldn't find anything on it. This example may point you in the right direction... (but substitue your own sql call) rstat=context.Users.SQL_GetRetailersbyName(rStart='A%', rEnd='N%') print 'rstat.names= ',rstat.names() print 'rstat.data_dictionary= ',rstat.data_dictionary() print 'rstat.dictionaries= ',rstat.dictionaries() return printed hth Jonathan ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Zope Recordset Object
http://mail.zope.org/pipermail/zope-dev/1999-September/001414.html The only auxiliary structure I ever use is names, i.e. n2i = {} res = container.foo_zsql() nms = res.names() for i in range(len(nms)): n2i[nms[i]] = i Then I can address by name as in res[i][n2i['column_name']] jim Hello, I have a ZSQL Method, which is called by my python script. However, I am curious as to what type of object is returned when that call is made. It's some sort of a recordset (or resultset) object that behaves like a list...it doesn't seem to be a dictionary object though, but I can't find any object reference on it. I tried using rs.keys() but it says that method doesn't exist in that class. Does anyone have a member function list (object reference ) that's associated with this resultset or can tell me what kind of object is returned? I gave up on google, couldn't find anything on it. Thank you in advance! ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )