Oops.. I mixed two things.. The new parent passed to can_move can be stored
in the request argument, but it probably shouldn't.

The new parent returned by can_move, which was the subject of your
suggestion, is really required in page creation to fall back to in case the
original parent is illegal.

- If a page move is illegal, the error message is needed (and can be
enclosed in an exception as you suggested).

- If a page is created in an illegal position, the new parent is needed so
the page gets created somewhere, instead of being discarded, and the user
having to re-enter its data. I don't see how else the new page can be
placed, except for a brute-force-lookup of a legal position by examining
every existing page as a potential parent.


On Sat, May 31, 2014 at 3:40 AM, Ahmad Khayyat <[email protected]> wrote:

> On Sat, May 31, 2014 at 3:32 AM, Stephen McDonald <[email protected]> wrote:
>
>
>> I'd guess there's no need to define the alternative parent - it should
>> always be the previous parent prior to moving.
>>
>> On Sat, May 31, 2014 at 8:59 AM, Ahmad Khayyat <[email protected]>
>> wrote:
>>
>>> Also, the alternative new parent is used in page creation only to insert
>>> the new page in a legal position.
>>>
>> ​The alternative parent is used when creating a new page in an illegal
> position. The alternative parent argument can be stored in the request, but
> I thought an explicit separate argument is more appropriate, as it is
> /required/ for page creation. There is no other way really to determine the
> parent of a new page if the one it was created under is illegal.​
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to