[Catalyst] Catalyst Model Issue

gordon at gorste.plus.com gordon at gorste.plus.com
Fri Jul 29 16:14:03 GMT 2011


Alejandro

I am using the create fuction catalyst provides,  I find that is the best
way of creating the model.  Does it need 'source_name'  in the classes
that it creates.

Regards

Gordon


> On Tue, Jul 26, 2011 at 1:51 PM,  <gordon at gorste.plus.com> wrote:
>> Hi
>>
>> When I call create on a result set like the same in the catalyst
>> documentation like
>>
>>               my $book = $c->model('DB::Book')->create({title  =>
>> $title,
>> rating => $rating });
>>
>> I get the following error
>>
>> DBIx::Class::ResultSet::create(): Unable to perform storage-dependent
>> operations with a detached result source (source '_unnamed_' is not
>> associated with a schema). at
>> ./catalyst/test/script/../lib/test/Controller/Books.pm line 56
>
> Did you create the Schema classes yourself? or did you use the
> xxxx_create.pl script?
>
> I have found that static creation using the create helper script is
> the best solution because it gives you the flexibility to extend the
> DBIC model and it's also very easy to upgrade when your DB changes.
> The way to use the create script for DBIC is:
>
> script/xxxx_create.pl model [model_name] DBIC::Schema [namespace]
> create=static dbi:[sriver]:dbname=data/catmodels.db [user] [pass]
>
>
> --
> Alejandro Imass
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>





More information about the Catalyst mailing list