Yep, orderinglist handles that case.

Michael Bayer wrote:
> forwarded from pvt email....
> 
> orderinglist ?
> 
> Begin forwarded message:
> 
>> *From: *Emmett <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
>> *Date: *September 22, 2008 9:51:31 AM EDT
>> *To: *Michael Bayer <[EMAIL PROTECTED] 
>> <mailto:[EMAIL PROTECTED]>>
>> *Subject: **Re: Support for ordered lists of child items*
>>
>> Hello Michael, 18 months later, would your answer to Aaron still be
>> the same?
>>
>> I have a problem fitting what Aaron described. ie. save+restore of
>> child order after re-ordering in the Python side.  Re-ordering child
>> list elements would obviously be ideal, but I could cope with updating
>> an extra integer node attribute instead.
>>
>> I'm completely new to SA and at this stage skimming documentation and
>> looking at the tree examples. Found this thread, so wondering if some
>> newer SA magic can solve this, or if a custom collection class or
>> something else is the best solution.
>>
>> I also looked at the ElementTree examples, but they don't appear to
>> guarantee child order either - correct?
>>
>> Thanks in advance.  I looked at your activity in this group. Amazing!
>>
>>
>> On Apr 10 2007, 4:02 am, Michael Bayer <[EMAIL PROTECTED]>
>> wrote:
>>> we dont have the capability to automatically update ordering columns  
>>> when the elements of a list are moved around.  if you move the  
>>> elements around, you need to execute some step that will update the  
>>> index columns (or create a custom collection class that does this for  
>>> you).
>>>
>>> On Apr 9, 2007, at 12:42 PM, Aaron Digulla wrote:
>>>
>>>
>>>
>>>> Hello,
>>>
>>>> I'm looking for a feature but couldn't find it in the docs.
>>>
>>>> I have atreelike structure where the user can specify theorderof
>>>> thechildrenof a node. In DB lingo, I have a parentId and an index
>>>> column. When I loadchildren, they should be ordered by the index.
>>>> This seems to be supported.
>>>
>>>> Can SA also update the index column when I movechildrenin the list
>>>> around? Like:
>>>
>>>> # ... parent has threechildrenA, B C
>>>> item = parent.children[0]
>>>> del parent.children[0]
>>>> parent.children.insert (1, item)
>>>> # now, parent has threechildrenB, A, C
>>>
>>>> Regards,
> 
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to