On Thursday 20 November 2008 14:05:55 Peter Rabbitson wrote:
> jackal wrote:
> > I'll think about it. It may be better to create a new module, which adds
> > this functionality for (Inflate|Modify)Column...
>
> Please by all means share your design decisions with us before writing
> such a module. It would be a shame to not be able to merge this
> functionality into the upcoming .09 without breaking compatibility.
>
Maybe something like:
__PACKAGE__->magick_columns([EMAIL PROTECTED], [EMAIL PROTECTED], {
inflate => sub {}, deflate => sub {}
});
Pseudo columns defined in @attrs will be created, so you can use it as
ordinary columns in ORM.
inflate/deflate can operate with any @cols and @attrs and modify them if
needed.
So it can be used in conjunction with InflateColumn and/or ModifyColumn.
For example, you can inflate timestamp column into DateTime by InflateColumn,
then (maybe) modify DateTime object by ModifyColumn and then set correct
timezone depending on user preferences (column 'tz' for example, possibly in
other table) and set independent 'date' and 'time' pseudo-columns.
All this can be done without InflateColumn and/or ModifyColumn, ofcourse.
It's just an idea...
--
Kind regards, Eugeny.
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]