[Dbix-class] RFC: DBIx-Class-Tree

Aran Deltac aran at arandeltac.com
Mon Apr 3 23:15:49 CEST 2006


On 4/3/2006, "Nilson Santos Figueiredo Junior" <acid06 at gmail.com> wrote:

>On 4/3/06, Aran Deltac <aran at arandeltac.com> wrote:
>> The docs cover all the methods, but are not verbose by any means.  I bet
>> you are right that the grouping stuff needs a little more TLC.  If you
>> can tell me what about it didn't make sense then I will have a better
>> time making the docs for grouping easier to read.
>
>Well, I don't know what it didn't make sense because I really didn't get it.
>I still don't know what it does, maybe when I get home I'll play a
>little bit with it and find out.

Here's an example:  You are writing a tool for storing bookmarks of web
pages.  You want to be able to change the order of the bookmarks and
have the ability to support multiple users having their own bookmarks
seperate from everyone else, so you'd make the table look like:

bookmarks ( bookmark_id, user_id, position, title, url );

Then you'd position_column('position') and
grouping_column('user_id').  Then whenever you call one of the move_*,
insert, or delete methods it will only modify the position of objects
that have the same user_id as the one that you called the method on.

Make sense?

Aran

>-Nilson Santos F. Jr.
>
>_______________________________________________
>List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
>Wiki: http://dbix-class.shadowcatsystems.co.uk/
>IRC: irc.perl.org#dbix-class
>SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/



More information about the Dbix-class mailing list