<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1207,7 +1207,7 @@ class hEntry(models.Model):
                 self.updated.strftime('%c')
                 )
 
-class hNews(hEntry):
+class hNews(hEntry, LocationAwareMicroformat):
     &quot;&quot;&quot;
     The hNews model is used for representing online news content.
 </diff>
      <filename>models.py</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,17 @@
 &lt;div class=&quot;hnews hentry item&quot;&gt;
    &lt;p class=&quot;entry-title&quot;&gt;{% if instance.bookmark %}&lt;a rel=&quot;bookmark&quot; href=&quot;{{instance.bookmark}}&quot;&gt;{% endif %}{{instance.entry_title}}{% if instance.bookmark %}&lt;/a&gt;{% endif %}
    &lt;span class=&quot;vcard author&quot;&gt;&lt;span class=&quot;fn n&quot;&gt;{{instance.author}}&lt;/span&gt;&lt;/span&gt;
-   &lt;span class=&quot;source-org vcard&quot;&gt;&lt;span class=&quot;org fn&quot;&gt;{{instance.source_org}}&lt;/span&gt;&lt;/span&gt;
+   &lt;span class=&quot;source-org vcard&quot;&gt;
+      {% if instance.source_url %}
+      &lt;a class=&quot;url org fn&quot; href=&quot;{{instance.source_url}}&quot;&gt;
+          {{instance.source_org}}
+      &lt;/a&gt;
+      {% else %}
+      &lt;span class=&quot;org fn&quot;&gt;
+          {{instance.source_org}}
+      &lt;/span&gt;
+      {% endif %}
+   &lt;/span&gt;
    &lt;a href=&quot;{{instance.principles_url}}&quot; rel=&quot;principles&quot;&gt;&lt;img src=&quot;{{instance.principles_img}}&quot; /&gt;&lt;/a&gt;
    &lt;abbr class=&quot;updated&quot; title=&quot;{{instance.updated.isoformat}}&quot;&gt;{{instance.updated|date:&quot;D d M Y&quot;}}&lt;/abbr&gt;&lt;/p&gt;
    {% if instance.entry_summary %}
@@ -13,12 +23,12 @@
        {% if instance.dateline %}
        {% if instance.latitude and instance.longitude %}
        &lt;abbr title=&quot;{{instance.latitude}},{{instance.longitude}}&quot; class=&quot;dateline geo&quot;&gt;
-          {{instance.dateline}}
-       &lt;/abbr&gt;
+          {{instance.dateline|upper}}
+       &lt;/abbr&gt; &amp;mdash;
        {% else %}
        &lt;span class=&quot;dateline&quot;&gt;
-          {{instance.dateline}}
-       &lt;/span&gt;
+          {{instance.dateline|upper}}
+       &lt;/span&gt; &amp;mdash;
        {% endif %}
        {% endif %}
        {{instance.entry_content}}</diff>
      <filename>templates/hnews.html</filename>
    </modified>
    <modified>
      <diff>@@ -66,6 +66,9 @@ Add-on&lt;/a&gt; for Firefox (that supports more types of microformat).&lt;/p&gt;
 &lt;h3&gt;A single hEntry&lt;/h3&gt;
 {{entry|hentry}}
 
+&lt;h3&gt;A single hNews item&lt;/h3&gt;
+{{item|hnews}}
+
 &lt;h2&gt;Some Free Text Examples&lt;/h2&gt;
 
 &lt;!-- loc2 is another geo instance --&gt;</diff>
      <filename>templates/test.html</filename>
    </modified>
    <modified>
      <diff>@@ -413,3 +413,21 @@ def hentry(value, arg=None, autoescape=None):
         template_name = getattr(settings, 'HENTRY_MICROFORMAT_TEMPLATE', False) and settings.HENTRY_MICROFORMAT_TEMPLATE or HENTRY_MICROFORMAT_TEMPLATE
         return mark_safe(render_microformat(value, template_name))
 hentry.needs_autoescape = True
+
+@register.filter
+def hnews(value, arg=None, autoescape=None):
+    &quot;&quot;&quot;
+    Formats a value to conform with the hNews Microformat fragment
+    
+    Inspired by the markup found here:
+
+    http://microformats.org/wiki/hnews-examples
+    &quot;&quot;&quot;
+    if isinstance(value, datetime.datetime) or isinstance(value, str) or isinstance(value, unicode) or isinstance(value, float) or isinstance(value, int) or isinstance(value, long) or isinstance(value, complex):
+        return fragment(value, arg, autoescape)
+    else:
+        # lets try rendering something with the correct attributes for this
+        # microformat
+        template_name = getattr(settings, 'HNEWS_MICROFORMAT_TEMPLATE', False) and settings.HNEWS_MICROFORMAT_TEMPLATE or HNEWS_MICROFORMAT_TEMPLATE
+        return mark_safe(render_microformat(value, template_name))
+hentry.needs_autoescape = True
\ No newline at end of file</diff>
      <filename>templatetags/microformat_extras.py</filename>
    </modified>
    <modified>
      <diff>@@ -444,6 +444,43 @@ Add-on&lt;/a&gt; for Firefox (that supports more types of microformat).&lt;/p&gt;
 &lt;/div&gt;
 
 
+&lt;h3&gt;A single hNews item&lt;/h3&gt;
+
+&lt;div class=&quot;hnews hentry item&quot;&gt;
+   &lt;p class=&quot;entry-title&quot;&gt;&lt;a rel=&quot;bookmark&quot; href=&quot;http://www.latimes.com/news/local/la-me-chandler-obit,0,7195252.story&quot;&gt;L.A. Icon Otis Chandler Dies at 78&lt;/a&gt;
+   &lt;span class=&quot;vcard author&quot;&gt;&lt;span class=&quot;fn n&quot;&gt;David Shaw and Mitchell Landsberg&lt;/span&gt;&lt;/span&gt;
+   &lt;span class=&quot;source-org vcard&quot;&gt;
+      
+      &lt;a class=&quot;url org fn&quot; href=&quot;http://www.latimes.com&quot;&gt;
+          Los Angeles Times
+      &lt;/a&gt;
+      
+   &lt;/span&gt;
+   &lt;a href=&quot;http://www.latimes.com/news/nationworld/nation/la-0705lat_ethics_code-pdf,0,7257671.acrobat&quot; rel=&quot;principles&quot;&gt;&lt;img src=&quot;http://labs.ap.org/principles-button-blue.png&quot; /&gt;&lt;/a&gt;
+   &lt;abbr class=&quot;updated&quot; title=&quot;2006-02-27T00:00:00&quot;&gt;Mon 27 Feb 2006&lt;/abbr&gt;&lt;/p&gt;
+   
+   &lt;div class=&quot;entry-summary&quot;&gt;&lt;em&gt;An obituary of Los Angeles Times Publisher Otis Chandler&lt;/em&gt;&lt;/div&gt;
+   
+   
+   &lt;div class=&quot;entry-content&quot;&gt;
+       
+       
+       &lt;abbr title=&quot;34.0444444,-118.2666667&quot; class=&quot;dateline geo&quot;&gt;
+          LOS ANGELES, UNITED STATES
+       &lt;/abbr&gt; &amp;mdash;
+       
+       
+       Otis Chandler, whose vision and determination as publisher of the Los Angeles Times from 1960 to 1980 catapulted the paper from mediocrity into the front ranks of American journalism, died today of a degenerative illness called Lewy body disease. He was 78.
+   &lt;/div&gt;
+   
+  &lt;div&gt;
+      &lt;a rel=&quot;item-license&quot; href=&quot;http://www.latimes.com/services/site/lat-terms,0,6713384.htmlstory&quot;&gt;
+          Terms of service
+      &lt;/a&gt;
+  &lt;/div&gt;
+&lt;/div&gt;
+
+
 &lt;h2&gt;Some Free Text Examples&lt;/h2&gt;
 
 &lt;!-- loc2 is another geo instance --&gt;</diff>
      <filename>unit_tests/html_test/microformat_test.html</filename>
    </modified>
    <modified>
      <diff>@@ -668,6 +668,8 @@ class TemplateTagsTestCase(TestCase):
             item1.license_description = 'Terms of service'
             item1.locality = 'Los Angeles'
             item1.country_name = 'US'
+            item1.longitude = -118.2666667
+            item1.latitude = 34.0444444
             item1.save()
 
             # All the data is defined so lets render the test template...</diff>
      <filename>unit_tests/test_templatetags.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9cf583d544fcb9bace21ffb2d7dee4959783c6d1</id>
    </parent>
  </parents>
  <author>
    <name>Ben Welsh</name>
    <email>benwelsh@tuohy.local</email>
  </author>
  <url>http://github.com/ntoll/microformats/commit/9336c07bda5f1237827919d3f3d7ebeed0587840</url>
  <id>9336c07bda5f1237827919d3f3d7ebeed0587840</id>
  <committed-date>2009-10-22T20:40:02-07:00</committed-date>
  <authored-date>2009-10-22T20:40:02-07:00</authored-date>
  <message>Refactored hNews model so it now also draws from the geo base model; Added my test item to the test.html; It passed the test and looks decent</message>
  <tree>2e14582c97d94da81c0388f1291bb6bcb58d2bc6</tree>
  <committer>
    <name>Ben Welsh</name>
    <email>benwelsh@tuohy.local</email>
  </committer>
</commit>
