Paul McNett wrote:
> Ed Leafe wrote:
>> On Apr 26, 2007, at 10:14 PM, Carl Karsten wrote:
>>
>>>>    I guess they should also include what happens if you specify
>>>> rows="Flower", or rows=time.localtime(), but I guess I was too busy
>>>> to worry about meaningless cases.
>>> I'm not sure what you think I was getting at... so let me try again:
>>> What should happen when rows=None?
>>      It should blow up, since that's a nonsensical case. You're calling a  
>> method designed to return data, but telling it not to return rows?  
>> What's the point?
> 
> What are you smoking? :)  rows=None is the default for getDataSet. rows 
> specifies the number of rows to be returned. So if rowStart is 0, all 
> rows will be returned. And if rowStart is 23, all the rest of the rows, 
> starting with row 23, will be returned. This isn't explicit in the 
> docstring, it is one of those things that is obvious to you and me 
> because it wouldn't make sense for it to be interpreted in the other way 
> "return all rows no matter what rowStart was set at".
> 
> So, setting rows=None isn't invalid, but it also doesn't mean "return no 
> rows". Let's fix the docstring and move on. Carl?
> 

There is still a bug somewhere, don;t know if it is in my code or dabo.  I 
thought it might be in one of the getDataSet()s, but now I think it is my code:

class uLoopBO(dabo.biz.dBizobj):

      self.dbs = self.conn.cursor.getDataSet()
      self.dbs = self.getDataSet()

The first works, the 2nd doesn't.  I bet it has to do with the way I created 
the 
cursor, or hooked the cursor to the BO.

New info:  if I make this change:  (ret=flower)

        def getDataSet(self, flds=(), rowStart=0, rows=None):
                ret = 'flower' # None
                try:
                        cc = self._CurrentCursor
                except:
                        cc = None
                if cc is not None:
                        ret = self._CurrentCursor.getDataSet(flds, rowStart, 
rows)
                return ret


I get back 'flower' - so apparently something is wrong with ._CurrentCursor.

I bet this line of my code isn't right:
self.cursor = self.getDaboCursor()

class uLoopDO(dabo.db.dConnection):
   def getDBs(self,user):

     self.cursor = self.getDaboCursor()

     self.cursor.execute("""select distinct table_schema
       from information_schema.SCHEMA_PRIVILEGES
       where GRANTEE like %(user)s
       """, {'user':'%'+user+'%'} )

class uLoopBO(dabo.biz.dBizobj):

   def initProperties(self):
     self.host = 'dabodev.com'
     self.user = 'webuser'
     self.pw = 'foxrocks'
     self.sqlCmd = 'select * from tbl1'
     self.cursor = None
     self.dbs = []

   def findDBs(self):
     ci = dabo.db.dConnectInfo(DbType='mysql',
       Host=self.host,
       User=self.user,
       PlainTextPassword=self.pw )

     self.conn = uLoopDO(ci)
     self.conn.getDBs(self.user)
     # self.dbs = self.conn.cursor.getDataSet()
     self.dbs = self.getDataSet()
     print self.dbs  # 'flower'


I think there is a problem with me calling self.getDaboCursor() at all, or at 
least not storing the result to _CurrentCursor, which I don't think I should be 
touching.

So how do I get _CurrentCursor setup correctly?

Carl K


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to