Re: [sqlalchemy] Re: Question about collection_class=ordering_list and Bullet.slide = slide

2016-09-23 Thread HP3
Thank you very much Mike! The behavior I am getting is very strange. The test case (I posted and then removed by accident) validates the behavior of "append to list". IOW: position is correct and not None. 105 def test_backref_set(self): 106 self._setup(ordering_list('position'))

Re: [sqlalchemy] Re: Question about collection_class=ordering_list and Bullet.slide = slide

2016-09-23 Thread Mike Bayer
The mechanism of backrefs is such that when you assign to the many-to-one side of the relationship, if the one-to-many is not loaded from the database, the "append" that you want to do does not occur at that time. When the list is not loaded, the object is placed in a queue where it will be

[sqlalchemy] Re: Question about collection_class=ordering_list and Bullet.slide = slide

2016-09-23 Thread HP3
There seems to be something else ... The following test passes which indicates that position is set as 0 right after the bullet and the slide are related: 93 def test_backref_set(self): 94 self._setup(ordering_list('position')) 95 96 #session = create_session() 97

[sqlalchemy] Re: Question about collection_class=ordering_list and Bullet.slide = slide

2016-09-23 Thread HP3
> > The test below (test/ext/test_orderinglist.py) demonstrates the behavior: > 93 def test_backref_set(self): 94 self._setup(ordering_list('position', count_from=0, 95 reorder_on_append=True)) 96 97 s1 = Slide('Slide #1') 98