Re: [Catalyst] Maturity of e-commerce modules in DJango when compared with Catalyst
Hi Alec, Whatever your choice of framework your real-life needs will very quickly outgrow the functionality available in the ecommerce modules that you started with, and you will end up needing to make non-trivial changes to them or even rewriting from scratch sooner rather than later. This is because open source has always been exceptional at building infrastructure tools (think web servers, templating languages, databases, cacheing, etc.), but relatively mediocre at implementing business logic. So what I'd be looking for if I were you is the library that I'd be happiest to hack on rather than the one that looks most mature. Regarding Catalyst vs. Django, I have found Django to be too tightly coupled for my preferences. Whereas Catalyst::Runtime is small and relatively lean, and you get stuff done by using plugins, roles, and (kinda) inversion of control, Django prefers being monolithic and shipping with loads of stuff in the core. The latter approach has a lower learning curve and helps you get started much faster, but I've found that a more decoupled architecture always pays off big time in the long term. I have also used Drupal in the past but it has always been more pain that it is worth. In particular, Drupal modules tend to be very poorly written and quite difficult to extend, especially compared to the modules that you get on CPAN. Cheers, -- Peter From: Alec Taylor alec.tayl...@gmail.com To: The elegant MVC web framework catalyst@lists.scsys.co.uk Sent: Wednesday, 23 November 2011, 13:41 Subject: Re: [Catalyst] Maturity of e-commerce modules in DJango when compared with Catalyst Looking good, I'll keep an eye on it and consider moving from Rails or DJango when it's fully released. =] /me will alpha test :) On Thu, Nov 24, 2011 at 12:23 AM, Kaare Rasmussen ka...@jasonic.dk wrote: My question to both users-groups is, how mature are your e-commerce modules? There isn't (AFAIK) an off-the-shelf e-commerce solution in catalyst, however - Mango and Handel (both available on cpan and github) provide the framework with the features you require, they aren't widely used Perhaps you could keep an eye on Interchange, http://www.linuxia.de/talks/ppw2011/perlcommerce-beamer.pdf While the old Interchange is a monolithic application, showing its age, the current plan is to release the relevant bits on CPAN. Most notably right now is Nitesi, https://metacpan.org/module/Nitesi. I think they're using Dancer for rewriting Interchange. I hope to use Nitesi and friends separately in my CMS. ___ List: Catalyst@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/ ___ List: Catalyst@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/ ___ List: Catalyst@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/
[Catalyst] Questions with Authentication/Authorization
Hi, As a beginner with Catalyst authentication I've got a few questions on which I'm struggling at the moment: Starting situation: * I've got to authenticate the user against a database to get the role (each user only can have ONE role) In my database there are two tables: USERINFO - containig attributes for PK, USERNAME (attributename: userinfo_kuerzel) and foreign key to table ROLE (attribute name: fk_bdbrolle_pk) ROLE - containig attributes for PK and ROLE (attribute name: bdbrolle_name) Within my catalyst configuration I've the following realm configured: authentication: default_realm: db realms: db: credential: class: Password password_field: userinfo_password password_type: clear store: class: DBIx::Class user_model: BDB::Userinfo user_field: userinfo_kuerzel role_relation: fk_bdbrolle_pk role_field: bdbrolle_name I succeeded to authenticate against this realm: -- if ($c-authenticate({userinfo_kuerzel = $username, userinfo_password = ''}, db) ) { # Authenticate against realm ... # The username is available here via $c-user-userinfo_kuerzel; # so my realm seems to get data ... # The role is available here via $c-user-fk_bdbrolle_pk-bdbrolle_name; # so my realm seems to get data ... # $c-assert_user_roles( qw/Wizard/ ); # This fails!! but $c-user-fk_bdbrolle_pk-bdbrolle_name IS Wizard $c-stash-{template} = 'index.tt'; $c-forward( $c-view('TT') ); } * Within index.tt I try to access the username and role - which also works. I use something like this: [% IF c.user %]Willkommen, [% c.user.userinfo_kuerzel %]([% c.user.fk_bdbrolle_pk.bdbrolle_name %])[% ELSE %]Not logged in[% END %] -- Questions: * Isn't $c-user a persistent value within $c? When I try to access to c.user later (after successfull login) $c-user is undefined. What is neccessary to make it persistent? * When I try to check the user role for example via $c-assert_user_roles( qw/Wizard/ ); (c.user.fk_bdbrolle_pk.bdbrolle_name has been Wizard in my example) this fails completely: Caught exception in BDBInfo2::Controller::Root-login Can't locate object method search via package BDBInfo2::Model::BDB::Bdbrolle at .../Catalyst/Authentication/Store/DBIx/Class/User.pm line 144. What's wrong here? I tried several things - but cannot find any solution yet ... Any help welcome - Thanks in advance! Johannes -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de ___ List: Catalyst@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/
Re: [Catalyst] Questions with Authentication/Authorization
On 24 Nov 2011, at 12:40, Johannes Kilian wrote:: * Isn't $c-user a persistent value within $c? When I try to access to c.user later (after successfull login) $c-user is undefined. What is neccessary to make it persistent? The session plugin (with a session store etc) needs to be setup for authentication to persist across requests. * When I try to check the user role for example via $c- assert_user_roles( qw/Wizard/ ); (c.user.fk_bdbrolle_pk.bdbrolle_name has been Wizard in my example) this fails completely: Caught exception in BDBInfo2::Controller::Root-login Can't locate object method search via package BDBInfo2::Model::BDB::Bdbrolle at .../ Catalyst/Authentication/Store/DBIx/Class/User.pm line 144. What's wrong here? I tried several things - but cannot find any solution yet ... I think this is as your role is a single foreign key, rather than a link table. Can you try again with Devel::SimpleTrace to get a full backtrace out, and also show us the DBIC Row classes for the two tables concerned? Cheers t0m ___ List: Catalyst@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/
Re: [Catalyst] Questions with Authentication/Authorization
On 24 Nov 2011, at 14:15, Johannes Kilian wrote: * Isn't $c-user a persistent value within $c? When I try to access to c.user later (after successfull login) $c-user is undefined. What is neccessary to make it persistent? The session plugin (with a session store etc) needs to be setup for authentication to persist across requests. OK - have to figure out how to do this. BTW: would be nice if this could be mentioned in the tutorial as well ... It is: http://search.cpan.org/~hkclark/Catalyst-Manual-5.9002/lib/Catalyst/Manual/Tutorial/05_Authentication.pod#Include_Authentication_and_Session_Plugins Will get back about the actual problem later when I have a sec to think :) Cheers t0m ___ List: Catalyst@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/