Some advice on the 'dabo' way to do this!

In my bizObj I have a beforeDelete method where I want to stop the deletion if 
a reference to the record occurs in another table (ie this table is membership 
types - I don't want to allow deletion of a membership type if a member exists 
with this type on their record).

My natural inclination is to do a SQL query against the related table for the 
entry, and to block the deletion if the rowcount returned is greater than zero. 
I tried doing this using my dConnection, ie

 def beforeDelete(self):
     ret = ""
     # if a member has this type do not allow delete
     app = self.Application
     conn = app.getConnectionByName("LodgeBooks")
     c = conn.cursor()
     c.execute("select * from Members where MembershipType = %s" % 
(self.Record.MTypeID))
     if c.fetchone() != None:
         ret = "value in use."
     return ret

but the dConnection class does not have a cursor ....
so - any suggestions

Thanks,    Rodgy

--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
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/2e1ffee4ece44dc4a8ef2473afcf0...@roger

Reply via email to