<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: SimpleBlog Part 3 - many-to-many relationships</title>
	<atom:link href="http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/</link>
	<description>Bring out the g33k</description>
	<pubDate>Thu, 20 Nov 2008 15:05:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: mackieboy</title>
		<link>http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-33711</link>
		<dc:creator>mackieboy</dc:creator>
		<pubDate>Wed, 01 Aug 2007 02:56:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-33711</guid>
		<description>help...really am a starter here.
I'm having problems when calling flush-
&#62;&#62;&#62;t1.flush 
there is this raise exceptions.SQLError...how can i fix it?
Im using python 2.4.
thanks</description>
		<content:encoded><![CDATA[<p>help&#8230;really am a starter here.<br />
I&#8217;m having problems when calling flush-<br />
&gt;&gt;&gt;t1.flush<br />
there is this raise exceptions.SQLError&#8230;how can i fix it?<br />
Im using python 2.4.<br />
thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam D.</title>
		<link>http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-33708</link>
		<dc:creator>Sam D.</dc:creator>
		<pubDate>Sat, 28 Jul 2007 12:37:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-33708</guid>
		<description>The Tag class could be improved as follows:

    @classmethod
    def normalise_tag_name(cls, tag_name):
        return '+'.join(tag_name.lower().split())

'split()' with no arguments will remove runs of one or more whitespace characters.</description>
		<content:encoded><![CDATA[<p>The Tag class could be improved as follows:</p>
<pre><code>@classmethod
def normalise_tag_name(cls, tag_name):
    return '+'.join(tag_name.lower().split())
</code></pre>
<p>&#8217;split()&#8217; with no arguments will remove runs of one or more whitespace characters.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cory</title>
		<link>http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-33201</link>
		<dc:creator>Cory</dc:creator>
		<pubDate>Thu, 22 Feb 2007 05:50:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-33201</guid>
		<description>Instead of placing tag parsing into the model (and mixing the domain logic with the binding logic), try placing into into a validator. In Turbogears validators serve two purposes: validate and bind. From the docs, it is very easy to overlook the binding aspect of it. 
Example:
    class TagConvertor(String):
        def to_python(self, value, state):
            #do string to tag(s) conversion
        def from_python(self, value):
            #do tag object to string conversion

You would still have to deal with the persistence aspect in either the model or a DAO layer, but you'd have slightly easier time tracking the domain logic.

Then again, this could be like take a flamethrower to an anthill.

(Let's see it if the formatting work out, eh?)</description>
		<content:encoded><![CDATA[<p>Instead of placing tag parsing into the model (and mixing the domain logic with the binding logic), try placing into into a validator. In Turbogears validators serve two purposes: validate and bind. From the docs, it is very easy to overlook the binding aspect of it.<br />
Example:<br />
    class TagConvertor(String):<br />
        def to<em>python(self, value, state):<br />
            #do string to tag(s) conversion<br />
        def from</em>python(self, value):<br />
            #do tag object to string conversion</p>
<p>You would still have to deal with the persistence aspect in either the model or a DAO layer, but you&#8217;d have slightly easier time tracking the domain logic.</p>
<p>Then again, this could be like take a flamethrower to an anthill.</p>
<p>(Let&#8217;s see it if the formatting work out, eh?)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Splee</title>
		<link>http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-21892</link>
		<dc:creator>Splee</dc:creator>
		<pubDate>Tue, 28 Nov 2006 21:28:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-21892</guid>
		<description>No problem.  FYI, you can either escape underscores with a backslash or escape each bit of code with a backtick.

Thanks for all the feedback.</description>
		<content:encoded><![CDATA[<p>No problem.  FYI, you can either escape underscores with a backslash or escape each bit of code with a backtick.</p>
<p>Thanks for all the feedback.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Webber</title>
		<link>http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-21821</link>
		<dc:creator>Matthew Webber</dc:creator>
		<pubDate>Tue, 28 Nov 2006 15:47:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-21821</guid>
		<description>Silly me, the above comment applies to part 4.</description>
		<content:encoded><![CDATA[<p>Silly me, the above comment applies to part 4.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Webber</title>
		<link>http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-21815</link>
		<dc:creator>Matthew Webber</dc:creator>
		<pubDate>Tue, 28 Nov 2006 15:31:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-21815</guid>
		<description>To continue my previous entry. This appears to be a problem with SQLalchemy and PostgreSQL. As a workaround, in controllers.py, change this statement in the comment function (undescore replaced by dash)

c = model.Comment(post=p, author-name=author-name,
author-email=author-email,
content=content)

so that you have
author_email=str(author_email), 

It's a workaround, but it might help someone.</description>
		<content:encoded><![CDATA[<p>To continue my previous entry. This appears to be a problem with SQLalchemy and PostgreSQL. As a workaround, in controllers.py, change this statement in the comment function (undescore replaced by dash)</p>
<p>c = model.Comment(post=p, author-name=author-name,<br />
author-email=author-email,<br />
content=content)</p>
<p>so that you have<br />
author<em>email=str(author</em>email), </p>
<p>It&#8217;s a workaround, but it might help someone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Webber</title>
		<link>http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-21814</link>
		<dc:creator>Matthew Webber</dc:creator>
		<pubDate>Tue, 28 Nov 2006 15:27:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-21814</guid>
		<description>I previously said 
&#62;&#62; The code provided for downloaded fails when you add a comment. The generated SQL does not have quote marks around the value of author-email. On the other hand, author-name works ok (underscore replace by dash to avoid WordPress formatting). </description>
		<content:encoded><![CDATA[<p>I previously said<br />
&gt;&gt; The code provided for downloaded fails when you add a comment. The generated SQL does not have quote marks around the value of author-email. On the other hand, author-name works ok (underscore replace by dash to avoid WordPress formatting). </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Webber</title>
		<link>http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-21524</link>
		<dc:creator>Matthew Webber</dc:creator>
		<pubDate>Mon, 27 Nov 2006 16:48:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-21524</guid>
		<description>Since you're written some admin code, it might be worth adding a note explaining how to get to it. Here's what I did -

Firstly, add a user via the shell
/usr/bin/tg-admin shell
u = User(user_name='example', email_address='example@example.com', display_name='Mr Example', password='secret')
g = Group(group_name='admin', display_name='Administrators')
g.users.append(u)

Then python start-simpleblog.py and point your browser to localhost:8080/admin</description>
		<content:encoded><![CDATA[<p>Since you&#8217;re written some admin code, it might be worth adding a note explaining how to get to it. Here&#8217;s what I did -</p>
<p>Firstly, add a user via the shell<br />
/usr/bin/tg-admin shell<br />
u = User(user<em>name=&#8217;example&#8217;, email</em>address=&#8217;example@example.com&#8217;, display<em>name=&#8217;Mr Example&#8217;, password=&#8217;secret&#8217;)<br />
g = Group(group</em>name=&#8217;admin&#8217;, display_name=&#8217;Administrators&#8217;)<br />
g.users.append(u)</p>
<p>Then python start-simpleblog.py and point your browser to localhost:8080/admin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Webber</title>
		<link>http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-21510</link>
		<dc:creator>Matthew Webber</dc:creator>
		<pubDate>Mon, 27 Nov 2006 15:27:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-21510</guid>
		<description>One other problem : The code provided for downloaded fails when you add a comment. The generated SQL does not have quote marks around the value of author-email. On the other hand, author-name works ok (underscore replace by dash to avoid WordPress formatting).

I'm not quite sure what is causing this. Maybe related to author-email being String rather than unicode?

Also, _underscore_ in a comment in obviously interpreted as a formatting directive. Is there a list of such directives (and how to escape them). A quick look at the WordPress site suprsiingly failed to turn up such a list.</description>
		<content:encoded><![CDATA[<p>One other problem : The code provided for downloaded fails when you add a comment. The generated SQL does not have quote marks around the value of author-email. On the other hand, author-name works ok (underscore replace by dash to avoid WordPress formatting).</p>
<p>I&#8217;m not quite sure what is causing this. Maybe related to author-email being String rather than unicode?</p>
<p>Also, <em>underscore</em> in a comment in obviously interpreted as a formatting directive. Is there a list of such directives (and how to escape them). A quick look at the WordPress site suprsiingly failed to turn up such a list.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Webber</title>
		<link>http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-21507</link>
		<dc:creator>Matthew Webber</dc:creator>
		<pubDate>Mon, 27 Nov 2006 15:02:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.splee.co.uk/2006/10/28/simpleblog-part-3-many-to-many-relationships/#comment-21507</guid>
		<description>Thanks for all this useful information. A couple of minor edits :

(1) tags_table = Table( ...
I prefer tag_table (singular not plural) for consistency with the naming convention used elsewhere.

(2)@param data Either a comma separated string ...
When I first saw this my eye tried to interpret it as some kind of decorator, due to the @ sign and the fact that the line above it was blank, so I didn't immediately realize it was a continued comment. Is this format a docstring convention?</description>
		<content:encoded><![CDATA[<p>Thanks for all this useful information. A couple of minor edits :</p>
<p>(1) tags<em>table = Table( &#8230;<br />
I prefer tag</em>table (singular not plural) for consistency with the naming convention used elsewhere.</p>
<p>(2)@param data Either a comma separated string &#8230;<br />
When I first saw this my eye tried to interpret it as some kind of decorator, due to the @ sign and the fact that the line above it was blank, so I didn&#8217;t immediately realize it was a continued comment. Is this format a docstring convention?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
