Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does the Django Atom1Feed use atom:updated instead of atom:published?
    primarykey
    data
    text
    <p>I made an Atom feed in Django using a class that looks something like this:</p> <pre><code>class AtomFeed(Feed): feed_type = feedgenerator.Atom1Feed # ... def item_pubdate(self, post): return datetime.datetime(post.date.year, post.date.month, post.date.day) </code></pre> <p>The resulting XML for an item:</p> <pre><code>&lt;entry&gt; &lt;title&gt;..&lt;/title&gt; &lt;link href="..." rel="alternate"&gt;&lt;/link&gt; &lt;updated&gt;2010-10-18T00:00:00+02:00&lt;/updated&gt; &lt;author&gt;&lt;name&gt;...&lt;/name&gt;&lt;/author&gt; &lt;id&gt;...&lt;/id&gt; &lt;summary type="html"&gt;...&lt;/summary&gt; &lt;/entry&gt; </code></pre> <p>The thing to note here is that the date goes in the <code>atom:updated</code> element, not the <code>atom:published</code> element.</p> <p>The <a href="http://tools.ietf.org/html/rfc4287#page-23" rel="nofollow">RFC</a> clearly suggests to me that this is not the intended usage:</p> <blockquote> <p>The "atom:updated" element is a Date construct indicating the most recent instant in time when an entry or feed was modified in a way the publisher considers significant. Therefore, not all modifications necessarily result in a changed atom:updated value.</p> </blockquote> <p>Whereas:</p> <blockquote> <p>The "atom:published" element is a Date construct indicating an instant in time associated with an event early in the life cycle of the entry.</p> </blockquote> <p>This is more than just a theoretical problem. Google Reader, for example, does not seem to use the <code>updated</code> element, and uses the date that it first saw the item appear. As a result, it does not order the items properly upon first import of the feed.</p> <p>The code in Django responsible for this:</p> <p><a href="http://code.djangoproject.com/browser/django/trunk/django/utils/feedgenerator.py#L331" rel="nofollow"><code>django/utils/feedgenerator.py:331</code></a></p> <pre><code>if item['pubdate'] is not None: handler.addQuickElement(u"updated", rfc3339_date(item['pubdate']).decode('utf-8')) </code></pre> <p>There appears to be no mention of the <code>published</code> element.</p> <p>Is this a bug in Django? Am I misunderstanding the Atom RFC? Am I missing something else?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload