<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Darwin&#039;s Theories - Python category</title>
  <link>http://theories.darwinsys.com:80/categories/python/</link>
  <description>Call it a Blog if you like -- Ian</description>
  <language>en</language>
  <copyright>Ian Darwin</copyright>
  <lastBuildDate>Sun, 19 Oct 2008 19:23:00 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>Django Reverse-Engineer from Existing Legacy Tables</title>
    <link>http://theories.darwinsys.com:80/2008/10/04/1223136720000.html</link>
    
      
        <description>
          I&#039;ve been playing a bit with &lt;a href=&#034;http://www.djangoproject.com/&#034;&gt;Django&lt;/a&gt;, a &lt;a href=&#034;http://www.python.org/&#034;&gt;Python&lt;/a&gt;-based web framework. One thing that people starting in Django seem to miss out on is the standard &amp;quot;how to I make model classes from my existing database tables&amp;quot;? That&#039;s not because you can&#039;t do this, but only because most of the newb tutorials start from the other end. It turns out that you can do this easily using &amp;quot;&lt;a href=&#034;http://docs.djangoproject.com/en/dev/ref/django-admin/#inspectdb&#034;&gt;manage.py inspectdb&lt;/a&gt;&amp;quot;. And you&#039;re done, at least most of your work is done. This reverse engineering is not as complete as that in &lt;a href=&#034;http://www.seamframework.org/&#034;&gt;Seam&lt;/a&gt; (actually Hibernate) - no compound primary keys, and (presumably because Python&#039;s db support is less general than Java&#039;s JDBC) it only works on a few databases (PostgreSQL, MySQL and SQL Server, IIRC), but for those database it does the bulk of the work for you.&lt;br /&gt;
&lt;br /&gt;
So, this post is a bit away from my usual topics. I admit it, I&#039;m mainly posting this here in hopes that somebody else using a web search will find the answer more quickly.
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <category>Python</category>
    
    <category>Web</category>
    
    <comments>http://theories.darwinsys.com:80/2008/10/04/1223136720000.html#comments</comments>
    <guid isPermaLink="true">http://theories.darwinsys.com:80/2008/10/04/1223136720000.html</guid>
    <pubDate>Sat, 04 Oct 2008 16:12:00 GMT</pubDate>
  </item>
  
  </channel>
</rss>
