Cory Cross wrote:
> I have a Parent-Child-Grandchild situation where the grandchild is for
> viewing only and is made up of several tables joined together. Using a
> Customers-Orders-Miscellaneous analogy, I have a text box from the
> Orders bizobj showing the order date and a second text box below
> showing the day of the week that order was placed, pulled from the
> grandchild bizobj. The order date is the foreign key to the the
> grandchild.
> 
> If I change the date, save my changes, and requery, the 'day of the
> week' textbox changes to the correct value.
> If I directly call for a requery and say No to save, it does not change.
> I tried calling various update() and refresh() methods with no luck.
> 
> Is there a way to update the 'day of the week' field without saving?
> Should I not have the inheritance relationship and use the DataSet and
> python logic to get the 'day of the week' display to update
> automatically?

Sounds like DOW is derived from orders.date. I'd use VirtualFields for 
this.

class BizOrders(dabo.biz.dBizobj):
        def initProperties(self):
                ...
                self.VirtualFields["dow"] = self.getOrderDOW

        def getOrderDOW(self):
                return getDOW(self.Record.order_date)

And then set that textbox DataSource to 'orders' and DataField to 'dow'. 
You need to provide the getDOW() function, but there are recipes on the 
Internet and there's always dateutil which does this and much much more.

-- 
pkm ~ http://paulmcnett.com


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to