Re: [dabo-dev] dabo Commit 4040

Author: Ed Leafe

Posted: 2008-04-16 at 11:19:13

On Apr 16, 2008, at 9:40 AM, johnf wrote:

> For some reason the list is not allowing me to provide the info you

> need.

It's called "failure to trim replies". It recognizes its own footer

in a quote, and considers that and anything below it to be waste.

> Field 'prodcostDescript' does not exist in the DataStructure is the

> error.

> below is the class.

>

> class PublicagprodcostBizobj(dabo.biz.dBizobj):

> def afterInit(self):

> self.DataSource = "public.agprodcost"

> self.VirtualFields={'prodcostDescript':self.costtype}

So this is being called before the afterInit() of the bizobj has run?

Can you change getDataTypeForField() to the code below, and let me

know what it prints out?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

def getDataTypeForField(self, fld):

"""Given a field name, returns its Python type, or None if no

DataStructure information is available.

"""

lp = dabo.dBug.logPoint()

print "\n%s" % lp

print "VF KEYS: %s", str(self.VirtualFields.keys())

if fld in self.VirtualFields:

return type(self.getFieldVal(fld))

ds = self.getDataStructure()

if not ds:

return None

try:

fldInfo = [rec[1] for rec in ds

if rec[0] == fld][0]

except IndexError:

raise ValueError, _("Field '%s' does not exist in the

DataStructure") % fld

return dabo.db.getPythonType(fldInfo)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-- Ed Leafe

©2008 Ed Leafe