#1151: child-parent relation after parent.new with ParentLinkField
----------------------+-----------------------------------------------------
Reporter: kweinert | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone: 0.8.3
Component: biz | Version: 0.8.2
Keywords: |
----------------------+-----------------------------------------------------
Hello,
still studying the Parent-Child bizobj structure, I have a small
suggestion:
in dBizobj._setParentLinkField, wouldn't it be nice to insert a check if
the named parent link field
is in Parent.NonUpdateFields? -- And if is not, log a warning or
something? As this is an one-time-operation,
it is not expensive.
Or otherwise, could dBizobj.setFieldVal be adapted to notify its children
so they can "move" to the
right dataset? (BTW: currently, setFieldVal references an undefined
variable ret if self._CurrentCursor is None.)
In my small example, I did on the parent
parent.setFieldVal("non_pk_key", "myvalue") # child.ParentLinkField =
"non_pk_key"
parent.requeryAllChildren()
which works nice (i.e. the child shows the right dataset). If I call
parent.new() before that,
however, the child's dataset remains empty.
Below there is a testcase showing the problem.
--
Ticket URL: <http://trac.dabodev.com/ticket/1151>
Dabo Trac <http://trac.dabodev.com>
Trac Page for Dabo
_______________________________________________
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]