I have a legacy database that encodes three booleans into an integer,
0-7. I've like to present three accessors alongside the other columns
that map to that integer. If I can automagically update it all the
better.

So I have,

$chart->story_text_used() # 0-7, real database column

and would prefer

$chart->show_headline() # 0,1; not in the db
$chart->show_synopsis() # ditto
$chart->show_comment() # ditto

One thought was: I see there's an example of overriding store_column
in the cookbook, presumably I'd need to override override get_column
as well?

Or is there another way?

In particular, I'd like to be able to say "these are non-DB-backed
columns" and instantiate them on the fly rather than necessarily
putting them in the schema class. So e.g. in a Cat controller I could
make a couple of columns on the fly that the template could use just
as another column. Is this possible? I know it sounds kind of horrible
but it would at the very least help debugging.

Thanks,
Paul

_______________________________________________
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/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to