Re: [Catalyst] recommendation
On Mon, Nov 10, 2008 at 08:46:21PM +0200, Octavian Rasnita wrote: However, if I need to use DBIx::Class::DigestColumns, I don't know how to add the following statement in a BEGIN block after it was already created by the Catalyst helper without the digest_check_method key: __PACKAGE__-add_columns( 'password' = { data_type = 'char', size = 32, digest_check_method = 'check_password', } You can call add_columns again with the extra info. DBIx::Class doesn't mind. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical Directorhttp://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/ ___ 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] recommendation
From: Matt S Trout [EMAIL PROTECTED] On Mon, Nov 10, 2008 at 08:46:21PM +0200, Octavian Rasnita wrote: However, if I need to use DBIx::Class::DigestColumns, I don't know how to add the following statement in a BEGIN block after it was already created by the Catalyst helper without the digest_check_method key: __PACKAGE__-add_columns( 'password' = { data_type = 'char', size = 32, digest_check_method = 'check_password', } You can call add_columns again with the extra info. That's great! This means that anything could be put in the class below the do not modify this or anything above. I have no idea where exactly, but I think this thing should be told somewhere in the POD docs, because it would be very helpful for the beginners that use the Catalyst helper. Octavian ___ 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] recommendation
From: Chisel Wright [EMAIL PROTECTED] On Mon, Nov 10, 2008 at 07:31:09PM +0200, Octavian Rasnita wrote: Especially for a beginner, but not only, the most simple way of creating the DBIC classes for a Catalyst app is to use the DBIC::Schema helper. I've seen that there are many components of DBIx::Class that can't be used if using this helper, because they should be loaded before Core or they require changing the part of the class that can't be modified. Which is the recommended way for creating a complex app that needs using those components? I'm not 100% certain what you're asking here. Are you using DBIx::Class::Schema::Loader with create=dynamic? No, I use it with create=static. I've always used create=static to give me the initial files to work from, and have extended, adjusted and tweaked them as I extend my schema. After the initial create.pl has been run I make all changes manually. I'm probably doing it wrong though. When I make changes to the database, I use to make them all, then update the DBIC schema with the Catalyst helper. If I would need to make the changes manually, I could forget that I've changed the length of a field in a table, or that I added a foreign key in another table, and I don't know how to avoid that because using the Catalyst helper was much easier. But maybe using the Catalyst helper only is not a good way either. It would be very helpful if there would be a recommended way of using Catalyst, DBIC, HTML::FormFu, UTF8Columns, SHA-1 encoded columns and other few components which are very useful in a Catalyst app that would require as few effort as possible. Octavian ___ 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] recommendation
From: Ashley [EMAIL PROTECTED] On Nov 10, 2008, at 9:31 AM, Octavian Rasnita wrote: I've seen that there are many components of DBIx::Class that can't be used if using this helper, because they should be loaded before Core or they require changing the part of the class that can't be modified. Which is the recommended way for creating a complex app that needs using those components? After we change something in the structure of some database tables, the single way of updating the DBIC classes is to make the update manually? You can put the extra component calls into a BEGIN block in the editable-lower section of the package. I don't seem to have any sample code handy, sorry. It's come up on the DBIC list before, I think. You might dig around in there if it's not obvious how to proceed. -Ashley Thank you for the idea of using a BEGIN block because it could help in some situations. However, if I need to use DBIx::Class::DigestColumns, I don't know how to add the following statement in a BEGIN block after it was already created by the Catalyst helper without the digest_check_method key: __PACKAGE__-add_columns( 'password' = { data_type = 'char', size = 32, digest_check_method = 'check_password', } I also searched for that thread you told about, but until now I couldn't find it. Thanks. Octavian ___ 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] recommendation
On Mon, Nov 10, 2008 at 07:31:09PM +0200, Octavian Rasnita wrote: Hi, Especially for a beginner, but not only, the most simple way of creating the DBIC classes for a Catalyst app is to use the DBIC::Schema helper. I tend to prefer using DBIC::Schema::Loader directly. Here's an example: #!/usr/bin/perl use warnings; use strict; use DBIx::Class::Schema::Loader qw/ make_schema_at /; make_schema_at(Zotero::Meta, { components = ['InflateColumn::DateTime'], debug = 1, relationships = 1, dump_directory = './lib' , }, [dbi:SQLite:dbname=db/meta.db, ,]); But the BEGIN block advice is also sound. As far as using EncodedColumn goes, I'd recommend having a look at Catalyst::Helper::AuthDBIC for an example of how to achieve this with Schema::Loader generated classes (although it doesn't use the BEGIN trick because I didn't know about it). I've seen that there are many components of DBIx::Class that can't be used if using this helper, because they should be loaded before Core or they require changing the part of the class that can't be modified. Which is the recommended way for creating a complex app that needs using those components? After we change something in the structure of some database tables, the single way of updating the DBIC classes is to make the update manually? Or it is recommended to avoid using components which are not compatible with the Catalyst helper? Thanks. Octavian ___ 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/
Re: [Catalyst] recommendation
Recommend using version control. Then you know what you have changed. -- Regards, Martin ([EMAIL PROTECTED]) IT: http://methodsupport.com Personal: http://thereisnoend.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/