Drew Taylor wrote: > Hi, > We just switched from CDBI to DBIC (.06999_07) for a webapp project > and I have a couple questions: > > 1) For one of the classes, I want the equivalent of CDBI's TEMP > columns or some other sort of bucket to place temporary data that will > never hit the database. I see that DBIx::Class uses > Class::Data::Accessor - but it appears to be class (not > object)-oriented. > > 2) I'm using DBIC w/ Catalyst, and thus am using C::P::DBIC::Schema > (latest version - no Loader). I'd like to have a base class common for > all my table objects (ie. a common toJSON() method), but can't figure > out how to do it in conjunction w/ the C::P::DBIC::Schema plugin. > > At first I just tried having My::Schema::User inherit directly from > My::Schema::BaseClass, but that makes DBIC barf on Catalyst startup. > After poking around in the docs, it seems that > $schema->compose_namespace() will do what I want but I have no idea > how to work this within the DBIC plugin.
I'd suspect that it barfed because when the schema tried loading the result source classes, it tried loading My::Schema::BaseClass as it's own source, which it isn't. I assume you have a main schema file, something like My::Schema, that loads the My::Schema::User via load_classes()? By default, it will load all of the classes, including BaseClass. Try loading all the classes BUT My::Schema::BaseClass in your Schema and see if that fixes the issue under Model::DBIC::Schema/Catalyst. -=Chris
signature.asc
Description: OpenPGP digital signature
_______________________________________________ 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]/
