Ticket #1132: dabo_test-code.py

File dabo_test-code.py, 1.2 kB (added by aklaver, 10 months ago)

Class Designer code file

Line 
1 # -*- coding: utf-8 -*-
2 ### Dabo Class Designer code. You many freely edit the code,
3 ### but do not change the comments containing:
4 ###         'Dabo Code ID: XXXX',
5 ### as these are needed to link the code to the objects.
6
7 ## *!* ## Dabo Code ID: dForm-top
8 def afterInitAll(self):
9     self.requery()
10
11 def createBizobjs(self):
12     class Publicplant1Bizobj(dabo.biz.dBizobj):
13         def afterInit(self):
14             self.DataSource = "public.dabo_test"
15             self.KeyField = "p_item_no"
16             self.addFrom("public.plant1")
17             self.addField("plant_type")
18             self.addField("p_item_no")
19             self.addField("user_update")
20             self.addField("variety")
21             self.addField("color")
22             self.addField("season")
23             self.addField("category_sub_type")
24             self.addField("user_insert")
25             self.addField("category_type")
26             self.addField("ts_insert")
27             self.addField("common")
28             self.addField("series")
29             self.addField("genus")
30             self.addField("ts_update")
31             self.addField("species")
32
33         def validateRecord(self):
34             """Returning anything other than an empty string from
35             this method will prevent the data from being saved.
36             """
37             ret = ""
38             # Add your business rules here.
39             return ret
40
41     publicplant1Bizobj = Publicplant1Bizobj(self.Connection)
42     self.addBizobj(publicplant1Bizobj)