<?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: Django multiple database support with DB switch feature</title>
	<atom:link href="http://www.meszaros.cz/2009/10/django-multiple-database-support-with-db-switch-feature/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.meszaros.cz/2009/10/django-multiple-database-support-with-db-switch-feature/</link>
	<description>reflections on technology and society</description>
	<lastBuildDate>Sat, 10 Dec 2011 05:42:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: admin</title>
		<link>http://www.meszaros.cz/2009/10/django-multiple-database-support-with-db-switch-feature/comment-page-1/#comment-763</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Thu, 17 Mar 2011 17:49:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.meszaros.cz/?p=51#comment-763</guid>
		<description>See official docs at http://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey</description>
		<content:encoded><![CDATA[<p>See official docs at <a href="http://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey" rel="nofollow">http://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: prague girl</title>
		<link>http://www.meszaros.cz/2009/10/django-multiple-database-support-with-db-switch-feature/comment-page-1/#comment-762</link>
		<dc:creator>prague girl</dc:creator>
		<pubDate>Thu, 17 Mar 2011 17:34:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.meszaros.cz/?p=51#comment-762</guid>
		<description>Is there more documentation on Foreign Key somewhere?  I&#039;m not finding it.

Jana</description>
		<content:encoded><![CDATA[<p>Is there more documentation on Foreign Key somewhere?  I&#8217;m not finding it.</p>
<p>Jana</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.meszaros.cz/2009/10/django-multiple-database-support-with-db-switch-feature/comment-page-1/#comment-21</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 27 Nov 2009 09:36:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.meszaros.cz/?p=51#comment-21</guid>
		<description>Yes, I am able to do that. The first condition is not to use foreign key constraints in the first table with foreign key on database level. This is apparent for MySQL MyISAM engine. If you use any other engine or any other DB backend, Django will implicitly try to create foreign key constraint. In that case, it is better to create the table manually with the foreign key column of simple integer type without any constraints. The other table, living in another database, must be defined as regular django model, which inherits from your custom overriden &quot;django.db.models.Model&quot; class. The overriden class must be using a custom &quot;Manager&quot;, which i simply overriden &quot;django.db.models.Manager&quot; class. 
If you want to perform SELECT or UPDATE commands on another database tables, you have to override the &quot;get_query_set&quot; method in your custom manager. If you also want do perform INSERT commands, you have to override the &quot;_insert&quot; method too.
For detailed how-to, please follow this link: http://djangrrl.com/view/multiple-database-connection-a-simple-use-case/</description>
		<content:encoded><![CDATA[<p>Yes, I am able to do that. The first condition is not to use foreign key constraints in the first table with foreign key on database level. This is apparent for MySQL MyISAM engine. If you use any other engine or any other DB backend, Django will implicitly try to create foreign key constraint. In that case, it is better to create the table manually with the foreign key column of simple integer type without any constraints. The other table, living in another database, must be defined as regular django model, which inherits from your custom overriden &#8220;django.db.models.Model&#8221; class. The overriden class must be using a custom &#8220;Manager&#8221;, which i simply overriden &#8220;django.db.models.Manager&#8221; class.<br />
If you want to perform SELECT or UPDATE commands on another database tables, you have to override the &#8220;get_query_set&#8221; method in your custom manager. If you also want do perform INSERT commands, you have to override the &#8220;_insert&#8221; method too.<br />
For detailed how-to, please follow this link: <a href="http://djangrrl.com/view/multiple-database-connection-a-simple-use-case/" rel="nofollow">http://djangrrl.com/view/multiple-database-connection-a-simple-use-case/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Malik Ehsanullah</title>
		<link>http://www.meszaros.cz/2009/10/django-multiple-database-support-with-db-switch-feature/comment-page-1/#comment-20</link>
		<dc:creator>Malik Ehsanullah</dc:creator>
		<pubDate>Thu, 26 Nov 2009 11:17:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.meszaros.cz/?p=51#comment-20</guid>
		<description>Are you able to access Foreign Key in a table which points to some other table which is present in some other database.</description>
		<content:encoded><![CDATA[<p>Are you able to access Foreign Key in a table which points to some other table which is present in some other database.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

