I wonder if some of this can be done implicitly. Take a look at what I ended up
with
in my ShapeEffect bizobj, in the overridden deleteAll() method (posting entire
bizobj
for context):
1 # -*- coding: utf-8 -*-
2
3 import datetime
4 import dabo
5 from base import Base
6
7
8 class ShapeEffect(Base):
9 def initProperties(self):
10 self.super()
11 self.DataSource = "shape_effect"
12 self.DataStructure = (
13 ("id", "C", True, "shape_effect", "id"),
14 ("shape_id", "C", False, "shape_effect", "shape_id"),
15 ("effect_id", "C", False, "shape_effect", "effect_id"),
16 ("expr", "C", False, "shape_effect", "expr"),
17 ("effect_notes", "C", False, "shape_effects", "notes"),
18 )
19 self.KeyField = "id"
20 self.LinkField = "shape_id"
21 self.FillLinkFromParent = True
22
23
24 def deleteAll(self, *args, **kwargs):
25 # refinteg from bizOpenings will delete all the shape effects
otherwise:
26 if self.ParentLinkField in ("", None, "id"):
27 self.super(*args, **kwargs)
28
29
30 def setBaseSQL(self):
31 self.addFrom("shape_effect")
32 self.addJoin("shape_effects", "shape_effects.id =
shape_effect.effect_id",
"left")
33 self.addFieldsFromDataStructure()
34 self.addOrderBy("shape_effect.effect_id")
35
So if the parent link field *doesn't* refer to the primary key of the child,
the
parent shouldn't cascade deletes to this bizobj. Is this something that is a
general
truth and we can therefore hard-code for in dabo?
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]