<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Gábor's blog</title>
  <link rel="alternate" type="text/html" href="http://www.nekomancer.net/blog/archives/manipulators-and-raw_id_admin"/>
  <link rel="self" type="application/atom+xml" href="http://www.nekomancer.net/node/134/atom/feed"/>
  <id>http://www.nekomancer.net/node/134/atom/feed</id>
  <updated>2008-03-28T18:46:28-05:00</updated>
  <entry>
    <title>Manipulators and raw_id_admin</title>
    <link rel="alternate" type="text/html" href="http://www.nekomancer.net/blog/archives/manipulators-and-raw_id_admin" />
    <id>http://www.nekomancer.net/blog/archives/manipulators-and-raw_id_admin</id>
    <published>2006-09-03T17:38:33-05:00</published>
    <updated>2008-03-28T18:46:28-05:00</updated>
    <author>
      <name>gabor</name>
    </author>
    <category term="django" />
    <category term="computers" />
    <summary type="html"><![CDATA[<p>for all Django users&#8230;</p>

<p>please, please, pretty please use <em>raw&#95;id&#95;admin</em> &#40;<a href="http://www.djangoproject.com/documentation/model_api/">django model docs</a>&#41;.</p>

<p>because, when you have a model that contains a ForeignKey (and people usually have ForeignKeys),
then when you use an automatic manipulator for the given model,
it will load in ALL THE DATA FROM ALL THE RELATED MODELS. for example,
if you have 20.000 entries in the related table, then it will load in all those 20.000 entries.</p>

<p>except, if you use <em>raw_id_admin</em>. it&#8217;s an attribute of the ForeignKey, and <a href="http://www.djangoproject.com/documentation/model_api/">contrary to the documentation</a>, it&#8217;s effect is not restricted to the admin-framework.</p>

<p>Joseph Heck made <a href="http://www.rhonabwy.com/wp/2006/08/31/a-subtle-django-performance-hit/">some speed-tests</a> regarding this issue</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>for all Django users&#8230;</p>

<p>please, please, pretty please use <em>raw&#95;id&#95;admin</em> &#40;<a href="http://www.djangoproject.com/documentation/model_api/">django model docs</a>&#41;.</p>

<p>because, when you have a model that contains a ForeignKey (and people usually have ForeignKeys),
then when you use an automatic manipulator for the given model,
it will load in ALL THE DATA FROM ALL THE RELATED MODELS. for example,
if you have 20.000 entries in the related table, then it will load in all those 20.000 entries.</p>

<p>except, if you use <em>raw_id_admin</em>. it&#8217;s an attribute of the ForeignKey, and <a href="http://www.djangoproject.com/documentation/model_api/">contrary to the documentation</a>, it&#8217;s effect is not restricted to the admin-framework.</p>

<p>Joseph Heck made <a href="http://www.rhonabwy.com/wp/2006/08/31/a-subtle-django-performance-hit/">some speed-tests</a> regarding this issue</p>
    ]]></content>
  </entry>
</feed>
