<div class="gmail_quote">On Wed, Mar 11, 2009 at 6:26 AM, Adam Witney <span dir="ltr">&lt;<a href="mailto:awitney@sgul.ac.uk">awitney@sgul.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On 11 Mar 2009, at 13:10, Tomas Doran wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Adam Witney wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
ok, so i posted too soon and have figured out the problem. I need to add &quot;Result&quot; into the relationships. Does the Tutorial need to be updated to reflect this? If so i have included below a quick patch against<br>

<br>
<a href="http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Manual/5.70/trunk/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod" target="_blank">http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Manual/5.70/trunk/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod</a><br>

</blockquote>
Can you re-submit as a unified diff against the base of the Catalyst-Manual distribution? (this makes it much easier for someone to read / apply).<br>
</blockquote>
<br></div>
is this what you mean?<br>
<br>
--- Catalyst-Manual-5.7018/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod  2009-03-08 23:56:26.000000000 +0000<br>
+++ MoreCatalystBasics.pod      2009-03-11 13:23:00.000000000 +0000<br>
@@ -1105,7 +1105,7 @@<br>
 C&lt;lib/MyApp/Model/DB.pm&gt;.  This file contains a reference to<br>
 C&lt;lib/MyApp/Schema.pm&gt;, so that file is loaded next.  Finally, the<br>
 call to C&lt;load_classes&gt; in C&lt;Schema.pm&gt; will load each of the &quot;result<br>
-class&quot; files from the C&lt;lib/MyApp/Schema&gt; subdirectory.  The end<div class="im"><br>
+class&quot; files from the C&lt;lib/MyApp/Schema/Result&gt; subdirectory.  The end<br></div>
 result is that Catalyst will dynamically create three table-specific<br>
 Catalyst models every time the application starts (you can see these<br>
 three model files listed in the debug output generated when you launch<br>
@@ -1126,7 +1126,7 @@<br>
 Result Class files. (Note: if you are using a database other than<br>
 SQLite, such as PostgreSQL, then the relationship could have been<br>
 automatically placed in the Result Class files.  If so, you can skip<br>
-this step.)  First edit C&lt;lib/MyApp/Schema/Books.pm&gt; and add the<div class="im"><br>
+this step.)  First edit C&lt;lib/MyApp/Schema/Result/Books.pm&gt; and add the<br></div>
 following text below the C&lt;# You can replace this text...&gt; comment:<br>
<br>
     #<br>
@@ -1138,7 +1138,7 @@<br>
     #     1) Name of relationship, DBIC will create accessor with this name<br>
     #     2) Name of the model class referenced by this relationship<br>
     #     3) Column name in *foreign* table (aka, foreign key in peer table)<br>
-    __PACKAGE__-&gt;has_many(book_authors =&gt; &#39;MyApp::Schema::BookAuthors&#39;, &#39;book_id&#39;);<div class="im"><br>
+    __PACKAGE__-&gt;has_many(book_authors =&gt; &#39;MyApp::Schema::Result::BookAuthors&#39;, &#39;book_id&#39;);<br>
<br></div>
     # many_to_many():<br>
     #   args:<br>
@@ -1178,7 +1178,7 @@<br>
 Note that you cannot define a C&lt;many_to_many&gt; relationship without<br>
 also having the C&lt;has_many&gt; relationship in place.<br>
<br>
-Then edit C&lt;lib/MyApp/Schema/Authors.pm&gt; and add relationship<div class="im"><br>
+Then edit C&lt;lib/MyApp/Schema/Result/Authors.pm&gt; and add relationship<br></div>
 information as follows (again, be careful to put in above the C&lt;1;&gt; but<br>
 below the C&lt;# DO NOT MODIFY THIS OR ANYTHING ABOVE!&gt; comment):<br>
<br>
@@ -1191,7 +1191,7 @@<br>
     #     1) Name of relationship, DBIC will create accessor with this name<br>
     #     2) Name of the model class referenced by this relationship<br>
     #     3) Column name in *foreign* table (aka, foreign key in peer table)<br>
-    __PACKAGE__-&gt;has_many(book_author =&gt; &#39;MyApp::Schema::BookAuthors&#39;, &#39;author_id&#39;);<div class="im"><br>
+    __PACKAGE__-&gt;has_many(book_author =&gt; &#39;MyApp::Schema::Result::BookAuthors&#39;, &#39;author_id&#39;);<br>
<br></div>
     # many_to_many():<br>
     #   args:<br>
@@ -1202,7 +1202,7 @@<br>
     __PACKAGE__-&gt;many_to_many(books =&gt; &#39;book_author&#39;, &#39;book&#39;);<br>
<br>
 Finally, do the same for the &quot;join table,&quot;<br>
-C&lt;lib/MyApp/Schema/BookAuthors.pm&gt;:<div class="im"><br>
+C&lt;lib/MyApp/Schema/Result/BookAuthors.pm&gt;:<br>
<br></div>
     #<br>
     # Set relationships:<br>
@@ -1213,14 +1213,14 @@<br>
     #     1) Name of relationship, DBIC will create accessor with this name<br>
     #     2) Name of the model class referenced by this relationship<br>
     #     3) Column name in *this* table<br>
-    __PACKAGE__-&gt;belongs_to(book =&gt; &#39;MyApp::Schema::Books&#39;, &#39;book_id&#39;);<div class="im"><br>
+    __PACKAGE__-&gt;belongs_to(book =&gt; &#39;MyApp::Schema::Result::Books&#39;, &#39;book_id&#39;);<br>
<br></div>
     # belongs_to():<br>
     #   args:<br>
     #     1) Name of relationship, DBIC will create accessor with this name<br>
     #     2) Name of the model class referenced by this relationship<br>
     #     3) Column name in *this* table<br>
-    __PACKAGE__-&gt;belongs_to(author =&gt; &#39;MyApp::Schema::Authors&#39;, &#39;author_id&#39;);<div class="im"><br>
+    __PACKAGE__-&gt;belongs_to(author =&gt; &#39;MyApp::Schema::Result::Authors&#39;, &#39;author_id&#39;);<br>
<br>
<br></div>
 =head2 Run The Application<br>
@@ -1249,7 +1249,7 @@<br>
<br>
 Let&#39;s add a new column to our book list page that takes advantage of<br>
 the relationship information we manually added to our schema files in<br>
-the previous section.  Edit C&lt;root/src/books/list.tt2&gt; add add the<br>
+the previous section.  Edit C&lt;root/src/books/list.tt2&gt; and add the<br>
 following code below the existing table cell that contains<br>
 C&lt;book.rating&gt; (IOW, add a new table cell below the existing two<br>
 C&lt;E&lt;lt&gt;tdE&lt;gt&gt;&gt; tags but above the closing C&lt;E&lt;lt&gt;/trE&lt;gt&gt;&gt; and<div><div></div><div class="h5"><br>
<br></div></div></blockquote><div><br></div><div>The line in the tutorial to create the static files is this:</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier">    $ script/myapp_create.pl model DB DBIC::Schema MyApp::Schema create=static dbi:SQLite:myapp.db</p>
<div> </div><div>I don&#39;t see where you got &#39;Result&#39; as part of the class name.</div></div><div><br></div>-J<br>