[Handel] Handel-0.99_05 getting started
Christopher H. Laco
claco at chrislaco.com
Tue Aug 22 17:15:47 CEST 2006
ryan lauterbach wrote:
> Hi,
>
> I'm trying to add the Handel cart to an existing site which uses
> Catalyst 5.7001 with DBIx::Class::Schema models. When I run the
> Handel::Scaffold helper I get a Cart model looking like:
>
> package App::M::Cart;
> use strict;
> use warnings;
> use base qw/Handel::Cart/;
>
> __PACKAGE__->connection_info('dbi:mysql:dbname', 'bleh', 'bleh');
>
> 1;
>
> Now is it possible to use my existing Schema connection info? I also
> get this error in the apache log:
>
> Can't locate object method "connection_info"
>
> Maybe the helper is still creating a Class::DBI type model??
OK. Bad news first. All of the Catalyst helper code needs to be
rewritten in 0.99_0x. The code included in the dist is the old 0.33
code. That process hasn't been started in earnest since I'm still
refactoring the Storage layer. :-/
As soon as I'm done writing tests and pod for the Storage/Storage::DBIC
stuffs, it is my #1 priority.
>
> Also is there an example schema somewhere of how to create the cart,
http://search.cpan.org/src/CLACO/Handel-0.99_05/sql/handel.sqlite.sql
> checkout, order database tables? Or a tutorial to follow or something,
> couldn't see how to bootstrap this thing from the cpan docs.
Yeah. That last big set of pod on my list is Tuts or Cookbookage on
initial setup and customizing tables/schemas.
>
> Many thanks!
>
> Ryan
Now, as for the mode problem, this may help (see attached files). It's
what I have on my USB stick at the moment. Just copy Cart ro Order and
change the appropriate class_name bits...
Connection info can be set using:
__PACKAGE__->config(
connection_info => []
)
in the apps models, or you can set it in the yml file:
Mode::Cart:
connection_info:
- dbi:Sqlite:handel.db
etc...Alternatively, this might work (untested):
> package App::M::Cart;
> use strict;
> use warnings;
> use base qw/Handel::Cart/;
>
> __PACKAGE__->storage->connection_info(['dbi:mysql:dbname', 'bleh', 'bleh']);
>
> 1;
If you're using the existing helper code, you're going to get bit by
template names as well...so you may need to set TEMPLATE_EXTENSION =>
'.tt' as well.
Unfortunately, 0.99_0x are dev releases, so you're un as-yet uncharted
waters.
-=Chris
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Cart.pm
Url: http://lists.rawmode.org/pipermail/handel/attachments/20060822/7dc6a9ae/attachment.diff
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Cart.pm
Url: http://lists.rawmode.org/pipermail/handel/attachments/20060822/7dc6a9ae/attachment-0001.diff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.rawmode.org/pipermail/handel/attachments/20060822/7dc6a9ae/attachment.pgp
More information about the Handel
mailing list