From: Kennedy Clark Date: Tue, 3 Mar 2009 22:48:26 +0000 (+0000) Subject: Update the "DBIC terminology" based on input from MST. Put in a note about "load_nam... X-Git-Tag: v5.8005~194 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=commitdiff_plain;h=feb4555a077523ed0583fa59e9f4ff843d5ae026 Update the "DBIC terminology" based on input from MST. Put in a note about "load_namespaces" with some tips on how to get started. Hope to migrate full to "load_namespaces" soon. --- diff --git a/Changes b/Changes index 61108ba..24206e7 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,7 @@ Revision history for Catalyst-Manual 5.7018 2 Mar 2009 - Suggestions and fixes with thanks to Murray Walker + - DBIC-related updates in MoreCatalystBasics - Fix misplaced "=over 4" in previous release - Reword warning about not using GET for delete based on input from kd - A few minor updates and fixes diff --git a/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod b/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod index 24c9157..1c2086a 100644 --- a/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod +++ b/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod @@ -1095,16 +1095,46 @@ changes below that point in the file, you can regenerate the automatically created information at the top of each file should your database structure get updated. -Also note the "flow" of the model information across the various files -and directories. Catalyst will initially load the model from -C. This file contains a reference to -C, so that file is loaded next. Finally, -the call to C in C will load each of the -table-specific "results source" files from the C -subdirectory. These three table-specific DBIC schema files will then be -used to create three table-specific Catalyst models every time the -application starts (you can see these three model files listed in -the debug output generated when you launch the application). +Also note the "flow" of the model information across the various files +and directories. Catalyst will initially load the model from +C. This file contains a reference to +C, so that file is loaded next. Finally, the +call to C in C will load each of the "result +class" files from the C subdirectory. The end +result is that Catalyst will dynamically create three table-specific +Catalyst models every time the application starts (you can see these +three model files listed in the debug output generated when you launch +the application). + +B The version of +L in +Ubuntu 8.10 uses the older DBIC C vs. the newer +C technique. For new applications, please try to use +C since it more easily supports a very useful DBIC +technique called "ResultSet Classes." This tutorial expects to migrate to +C when the next release of Ubuntu comes out. + +If you wish to try C now, you can manually do the +equivalent of the C operation outside of the Catalyst +helper: + + perl -MDBIx::Class::Schema::Loader=make_schema_at,dump_to_dir:./lib -e \ + 'make_schema_at("MyApp::Schema", { debug => 1, use_namespaces => 1, \ + components => ["InflateColumn::DateTime"] },["dbi:SQLite:myapp.db", "", "" ])' + +And then use the helper to only create the Catalyst model class: + + script/myapp_create.pl model DB DBIC::Schema MyApp::Schema dbi:SQLite:myapp.db + +B, it is important to note that C will look +for your C, , etc. files in +C (it adds the subdirection "Result" so that +there can also be a "ResultSet" directory next to it in the +hierarchy). Therefore, if you switch to C, you will +need to modify the path to these "result class" files throughout the +rest of the tutorial. Our recommendation for now would be to complete +the tutorial using C and the try converting to +C after you are done. =head2 Updating the Generated DBIC Schema Files