Here are some of the concerns from the other bug that apply:
Imagine the following set of classes (syntax is up in the air, but should get the point across):
class Bar(object): __storm_table__ = "bar"
id = Int(primary = True)
foo_id = Int()
qualifier = Int()
class Foo(Storm): __storm_table__ = "foo"
id = Int(primary=True)
bars = ConstrainedReferenceSet(id, Bar.foo_id, Bar.quaifier == 42)
1. If we issue the command "foo.bars.add(bar)", is it responsible for setting bar.qualifier? If not, should it try to verify that bar.qualifier is set appropriately, or leave that to database level constraints?
2. What is the result of the following statements:
foo = Foo()
bar = Bar()
bar.qualifier = 42
foo.bars.add(bar)
bar.qualifier = 0
del bar
store.add(foo)
store.flush()
3. What should "foo.bars.remove(bar)" do? The two possibilities are to set bar.foo_id to None (what happens with unconstrained reference sets), or change bar.qualifier (to what?).
Here are some of the concerns from the other bug that apply:
Imagine the following set of classes (syntax is up in the air, but should get the point across):
class Bar(object):
__storm_ table__ = "bar"
id = Int(primary = True)
foo_id = Int()
qualifier = Int()
class Foo(Storm):
__storm_ table__ = "foo" renceSet( id, Bar.foo_id, Bar.quaifier == 42)
id = Int(primary=True)
bars = ConstrainedRefe
1. If we issue the command "foo.bars. add(bar) ", is it responsible for setting bar.qualifier? If not, should it try to verify that bar.qualifier is set appropriately, or leave that to database level constraints?
2. What is the result of the following statements: bars.add( bar)
foo = Foo()
bar = Bar()
bar.qualifier = 42
foo.
bar.qualifier = 0
del bar
store.add(foo)
store.flush()
3. What should "foo.bars. remove( bar)" do? The two possibilities are to set bar.foo_id to None (what happens with unconstrained reference sets), or change bar.qualifier (to what?).