<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Another Step-by-Step SqlAlchemy Tutorial (part 2 of 2)</title>
	<atom:link href="http://www.blog.pythonlibrary.org/2010/02/03/another-step-by-step-sqlalchemy-tutorial-part-2-of-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blog.pythonlibrary.org/2010/02/03/another-step-by-step-sqlalchemy-tutorial-part-2-of-2/</link>
	<description>Python Programming from the Frontlines</description>
	<lastBuildDate>Fri, 30 Jul 2010 14:54:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Digimasterdoug</title>
		<link>http://www.blog.pythonlibrary.org/2010/02/03/another-step-by-step-sqlalchemy-tutorial-part-2-of-2/comment-page-1/#comment-20976</link>
		<dc:creator>Digimasterdoug</dc:creator>
		<pubDate>Tue, 15 Jun 2010 10:29:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=517#comment-20976</guid>
		<description>this is hands down the best practical sqlalchemy tutorial ive encountered to date.  thanks a ton!</description>
		<content:encoded><![CDATA[<p>this is hands down the best practical sqlalchemy tutorial ive encountered to date.  thanks a ton!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.blog.pythonlibrary.org/2010/02/03/another-step-by-step-sqlalchemy-tutorial-part-2-of-2/comment-page-1/#comment-16968</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Fri, 05 Feb 2010 19:05:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=517#comment-16968</guid>
		<description>@ jotr,

Added a note to that affect in that section. Mental note: don&#039;t get interrupted when working on next tutorial...

- Mike</description>
		<content:encoded><![CDATA[<p>@ jotr,</p>
<p>Added a note to that affect in that section. Mental note: don&#8217;t get interrupted when working on next tutorial&#8230;</p>
<p>- Mike</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jotr</title>
		<link>http://www.blog.pythonlibrary.org/2010/02/03/another-step-by-step-sqlalchemy-tutorial-part-2-of-2/comment-page-1/#comment-16966</link>
		<dc:creator>jotr</dc:creator>
		<pubDate>Fri, 05 Feb 2010 19:00:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=517#comment-16966</guid>
		<description>I find the joins work better after calling session.add(prof).</description>
		<content:encoded><![CDATA[<p>I find the joins work better after calling session.add(prof).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.blog.pythonlibrary.org/2010/02/03/another-step-by-step-sqlalchemy-tutorial-part-2-of-2/comment-page-1/#comment-16926</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Fri, 05 Feb 2010 00:33:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=517#comment-16926</guid>
		<description>@ jotr,

I actually tested all those methods on the declarative model...but yes, they all should work just fine.

Hmmm...looks like I dropped the create_all call from the declarative example. I just fixed that. 

I messed around with the dirty call in Wing and discovered that if I add the user to the database with a session.commit() and then change one of the user&#039;s attributes, then session.dirty picks it up. This is not clear in the official documentation. I updated this post to reflect that.

- Mike</description>
		<content:encoded><![CDATA[<p>@ jotr,</p>
<p>I actually tested all those methods on the declarative model&#8230;but yes, they all should work just fine.</p>
<p>Hmmm&#8230;looks like I dropped the create_all call from the declarative example. I just fixed that. </p>
<p>I messed around with the dirty call in Wing and discovered that if I add the user to the database with a session.commit() and then change one of the user&#8217;s attributes, then session.dirty picks it up. This is not clear in the official documentation. I updated this post to reflect that.</p>
<p>- Mike</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jotr</title>
		<link>http://www.blog.pythonlibrary.org/2010/02/03/another-step-by-step-sqlalchemy-tutorial-part-2-of-2/comment-page-1/#comment-16922</link>
		<dc:creator>jotr</dc:creator>
		<pubDate>Thu, 04 Feb 2010 22:43:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=517#comment-16922</guid>
		<description>Ah, I had to add a metadata.create_all(engine) after creating the metadata object.  Also I notice that even though I alter the &#039;mike_user&#039; object after calling session.add(), session.dirty does not reflect the change.</description>
		<content:encoded><![CDATA[<p>Ah, I had to add a metadata.create_all(engine) after creating the metadata object.  Also I notice that even though I alter the &#8216;mike_user&#8217; object after calling session.add(), session.dirty does not reflect the change.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jotr</title>
		<link>http://www.blog.pythonlibrary.org/2010/02/03/another-step-by-step-sqlalchemy-tutorial-part-2-of-2/comment-page-1/#comment-16921</link>
		<dc:creator>jotr</dc:creator>
		<pubDate>Thu, 04 Feb 2010 22:37:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=517#comment-16921</guid>
		<description>When I try to do a session.commit() after the session.add_all(...) example above, I get this error:

sqlalchemy.exc.OperationalError: (OperationalError) no such table: users u&#039;INSERT INTO users (name, fullname, password) VALUES (?, ?, ?)&#039; [&#039;mike&#039;, &#039;Mike Dirtskill&#039;, &#039;password&#039;]

Should the add_all() code work when appended to the declarative table definitions above?</description>
		<content:encoded><![CDATA[<p>When I try to do a session.commit() after the session.add_all(&#8230;) example above, I get this error:</p>
<p>sqlalchemy.exc.OperationalError: (OperationalError) no such table: users u&#8217;INSERT INTO users (name, fullname, password) VALUES (?, ?, ?)&#8217; ['mike', 'Mike Dirtskill', 'password']</p>
<p>Should the add_all() code work when appended to the declarative table definitions above?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://www.blog.pythonlibrary.org/2010/02/03/another-step-by-step-sqlalchemy-tutorial-part-2-of-2/comment-page-1/#comment-16920</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Thu, 04 Feb 2010 22:32:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=517#comment-16920</guid>
		<description>@ jotr,

Looks like I had it wrong in one example and right in the other. Duh! I should stick with my wxPython examples! Thanks for the heads-up.

- Mike</description>
		<content:encoded><![CDATA[<p>@ jotr,</p>
<p>Looks like I had it wrong in one example and right in the other. Duh! I should stick with my wxPython examples! Thanks for the heads-up.</p>
<p>- Mike</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jotr</title>
		<link>http://www.blog.pythonlibrary.org/2010/02/03/another-step-by-step-sqlalchemy-tutorial-part-2-of-2/comment-page-1/#comment-16918</link>
		<dc:creator>jotr</dc:creator>
		<pubDate>Thu, 04 Feb 2010 22:05:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=517#comment-16918</guid>
		<description>Perhaps ForeignKey(&#039;users_table.user_id&#039;) should instead be ForeignKey(&#039;users.user_id&#039;) in the first example.</description>
		<content:encoded><![CDATA[<p>Perhaps ForeignKey(&#8216;users_table.user_id&#8217;) should instead be ForeignKey(&#8216;users.user_id&#8217;) in the first example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Werner</title>
		<link>http://www.blog.pythonlibrary.org/2010/02/03/another-step-by-step-sqlalchemy-tutorial-part-2-of-2/comment-page-1/#comment-16897</link>
		<dc:creator>Werner</dc:creator>
		<pubDate>Thu, 04 Feb 2010 17:18:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=517#comment-16897</guid>
		<description>Mike,

My import&#039;s for SA look like this, it is a bit more typing but to me it makes the code more readable and it is less likely that I step onto something (e.g. Column = &#039;blabla&#039;).

import sqlalchemy as sa
import sqlalchemy.orm as sao
import sqlalchemy.sql as sasql
import sqlalchemy.ext.declarative as sad

Werner</description>
		<content:encoded><![CDATA[<p>Mike,</p>
<p>My import&#8217;s for SA look like this, it is a bit more typing but to me it makes the code more readable and it is less likely that I step onto something (e.g. Column = &#8216;blabla&#8217;).</p>
<p>import sqlalchemy as sa<br />
import sqlalchemy.orm as sao<br />
import sqlalchemy.sql as sasql<br />
import sqlalchemy.ext.declarative as sad</p>
<p>Werner</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bajusz Tamás</title>
		<link>http://www.blog.pythonlibrary.org/2010/02/03/another-step-by-step-sqlalchemy-tutorial-part-2-of-2/comment-page-1/#comment-16896</link>
		<dc:creator>Bajusz Tamás</dc:creator>
		<pubDate>Thu, 04 Feb 2010 17:09:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=517#comment-16896</guid>
		<description>The base ORM class recipe is here:
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/GenericOrmBaseClass</description>
		<content:encoded><![CDATA[<p>The base ORM class recipe is here:<br />
<a href="http://www.sqlalchemy.org/trac/wiki/UsageRecipes/GenericOrmBaseClass" rel="nofollow">http://www.sqlalchemy.org/trac/wiki/UsageRecipes/GenericOrmBaseClass</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.708 seconds -->
