[Catalyst] Subject: Simple question: setting pre-set fields/creation actions in Catalyst::Controller::DBIC::API::REST

Andy Holyer andyh.enable at gmail.com
Thu Jun 5 10:27:49 GMT 2014


I've been coding in Perl for years, but I'm still pretty new to Catalyst,
so please excuse the newbie question.

I'm putting together a Catalyst application which uses
Calalyst::Controller::DBIC::API::REST to interface with the database.

So, in lib/MyApp/Controller/ there are a bunch of files of the form
{Table}.pm, which each consists of basically a __PACKAGE__->config() call
setting various things, including create_requires, create_allows and so on.

Simple question: Several of these tables require status etc. to be set
heardwired in code, and several of the others have some business logic
which needs to take place on e.g. creation.

What's the canonical way to do this? I'm guessing it means defining a begin
method, but I'd really like to know the "proper" way to do this. Can't see
this anywhere in the docs (unless I'm looking in the wrong place), but it's
such a common occurrence it *must* be a FAQ.

Thanks in Advance.

Andy Holyer, Brighton, UK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/catalyst/attachments/20140605/3ceb0cb3/attachment.htm>


More information about the Catalyst mailing list