I like the idea of setting up my DataStructure in my code rather than changing 
my database (since, at least in theory, it could be in use by other apps and I 
don't want to break them). As I generated my Bizobj from within the 
ClassDesigner the code is not in the biz folder, but instead is in the code 
file for my screen (and saved in the ui folder) - code as below :-


def createBizobjs(self):
 class MembershiptypesBizobj(dabo.biz.dBizobj):
 
  def afterInit(self):
   self.DataSource = "MembershipTypes"
   self.KeyField = "MTypeID"
   self.addFrom("MembershipTypes")
   self.addField("MTypeDues")
   self.addField("MTypeDesc")
   self.addField("MTypeID")
   
  def validateRecord(self):
   """Returning anything other than an empty string from
   this method will prevent the data from being saved.
   """
   ret = ""
   myval = self.Record.MTypeDesc
   if myval is None or myval =='':
    ret = "Please enter a description"
   # need to focus back on text field here
   # Add your business rules here. 
   return ret

 membershipTypesBizobj = MembershiptypesBizobj(self.Connection)
 self.addBizobj(membershipTypesBizobj)
 self.requery()

Should I add an initProperties(self) method as in Uwe's example, set up the 
DataStructure in that, and then addFrom that data structure - or can I just set 
up the DataStructure directly and not need to add fields as a seperate step?
           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/[EMAIL PROTECTED]

Reply via email to