Hello Ed
Getting closer
Now the Save fails. It tries to save the clientname from the "join to
clients" file.
Error:
Save Failed:
column "clientname" of relation "hours" does not exist
LINE 1: ...ntfk","notes","hours","servicesate","billed","clientnam...
^
SQL: insert into "public"."hours"("clientfk","notes","hours",
"servicedate","billed","clientname") values (3,'This is a
test',2.0,'2008-07-06',0,NULL)
----------------------------------------------------------------------
The BizHours.py code is:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import dabo
import biz
import datetime
class BizHours(dabo.biz.dBizobj):
def afterInit(self):
self.DataSource = "public.hours"
self.KeyField = "pkid"
self.addField("public.hours.pkid")
self.addField("public.hours.clientfk")
self.addField("public.clients.clientname")
self.addField("public.hours.servicedate")
self.addField("public.hours.hours")
self.addField("public.hours.notes")
self.addField("public.hours.billed")
self.addFrom("public.hours")
self.addJoin("public.clients", "public.hours.clientfk =
public.clients.pkid")
self.DefaultValues = {"servicedate": datetime.date.today()}
def getClients(self):
crs = self.getTempCursor()
crs.execute("select pkid, clientname from public.clients order
by clientname")
ds = crs.getDataSet()
names = [rec["clientname"] for rec in ds]
keys = [rec["pkid"] for rec in ds]
return (names, keys)
------------------------------------------------------------------------
Why does it work in the tutorial but not for me?
Thanks
Paul McNary
[EMAIL PROTECTED]
_______________________________________________
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]