<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: genericforeignkey</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/genericforeignkey.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2008-06-24T11:09:25+00:00</updated><author><name>Simon Willison</name></author><entry><title>The basics of creating a tumblelog with Django</title><link href="https://simonwillison.net/2008/Jun/24/tumblelog/#atom-tag" rel="alternate"/><published>2008-06-24T11:09:25+00:00</published><updated>2008-06-24T11:09:25+00:00</updated><id>https://simonwillison.net/2008/Jun/24/tumblelog/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://ryanberg.net/blog/2008/jun/24/basics-creating-tumblelog-django/"&gt;The basics of creating a tumblelog with Django&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Ryan Berg suggests having a StreamItem model that links uses a GenericForeignKey to link to other content types, then using signals to cause a StreamItem to be created for every other model type. I should switch to doing that on this blog: at the moment I have to query three separate tables to build the tumblelog part which results in messy code for ordering and pagination.

    &lt;p&gt;&lt;small&gt;&lt;/small&gt;Via &lt;a href="http://www.b-list.org/links/2008/jun/24/tumble/"&gt;James Bennett&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/contenttypes"&gt;contenttypes&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/genericforeignkey"&gt;genericforeignkey&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/ryan-berg"&gt;ryan-berg&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/tumblelog"&gt;tumblelog&lt;/a&gt;&lt;/p&gt;



</summary><category term="contenttypes"/><category term="django"/><category term="genericforeignkey"/><category term="python"/><category term="ryan-berg"/><category term="tumblelog"/></entry></feed>