On Monday, December 20, 2010 01:59:42 pm Ed Leafe wrote:
> On Dec 20, 2010, at 4:54 PM, marcelo nicolet wrote:
> > Thank you again, John. But is exactly in the bizobj where it's
> > convenient to have an "array flavor" of these data, because some of the
> > biz rules involve a sum over the elements.
>
> If you requery the table, can you reference biz.Record.array_column
(where
> 'biz' is your bizobj, and 'array_column' is the Postgres array? Do you get
> a Python list of values?
>
>
> -- Ed Leafe
In testing I discovered the following:
CREATE TABLE sal_emp
(
"name" text,
pay_by_quarter integer[],
schedule text[]
)
WITH (
OIDS=FALSE
);
Using a standard bizobj class:
class Publicsal_EmpBizobj(dabo.biz.dBizobj):
def afterInit(self):
self.DataSource = "public.sal_emp"
self.KeyField = ""
self.addFrom("public.sal_emp")
self.addField("schedule")
self.addField("name")
self.addField("pay_by_quarter")
def validateRecord(self):
"""Returning anything other than an empty string from
this method will prevent the data from being saved.
"""
ret = ""
# Add your business rules here.
return ret
Using a standard cnxml connection. I added the bizobj to a form.
self.testbizobj= Publicsal_EmpBizobj(self.conn)
self.addBizobj(self.testbizobj)
I am able to access the field without issue.
self.testbizobj.Record.pay_by_quarter
provides a python list
_______________________________________________
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]