[Dbix-class] RFC: DBIx::Class::Sweet
Matt S Trout
dbix-class at trout.me.uk
Mon Apr 3 17:46:58 CEST 2006
Nilson Santos Figueiredo Junior wrote:
> Well, It's a module that adds some syntatic sugar to DBIx::Class.
> Currently, it only makes the DBIx::Class subclass "setup" easier on
> the eyes but I intend to develop it further as I see fit, maybe adding
> more substancial features.
>
> Here's what the code should look like when using it:
>
> package World::Person;
>
> use DBIx::Class::Sweet;
>
> setup_class {
>
> add_columns(qw/id name country_id/);
> set_primary_key('id');
> belongs_to( country => 'World::Country', 'country_id' );
>
> };
>
> I particularly think that __PACKAGE__ is ugly as hell. So this fixes it.
Btw: Why not just use
http://search.cpan.org/~bauerb/Class-Method-Auto-1.00/lib/Class/Method/Auto.pm
?
--
Matt S Trout Offering custom development, consultancy and support
Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information
+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
More information about the Dbix-class
mailing list