<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: django-hitcount: simple app to count hits/views for an object</title>
	<atom:link href="http://blog.damontimm.com/django-hitcount-app-count-hits-views/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.damontimm.com/django-hitcount-app-count-hits-views/</link>
	<description>Where I go to remember what I did</description>
	<lastBuildDate>Wed, 01 Feb 2012 21:11:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Nick</title>
		<link>http://blog.damontimm.com/django-hitcount-app-count-hits-views/comment-page-1/#comment-63918</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Mon, 23 Jan 2012 21:51:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.damontimm.com/?p=201#comment-63918</guid>
		<description>Easiest app I&#039;ve installed. :). Thanks for the hard work!</description>
		<content:encoded><![CDATA[<p>Easiest app I&#8217;ve installed. :). Thanks for the hard work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacquesknie</title>
		<link>http://blog.damontimm.com/django-hitcount-app-count-hits-views/comment-page-1/#comment-41521</link>
		<dc:creator>Jacquesknie</dc:creator>
		<pubDate>Fri, 24 Jun 2011 15:32:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.damontimm.com/?p=201#comment-41521</guid>
		<description>Hey Dmitry,
Thanks for your reply, but I still don&#039;t really get it. I have a model called Card, how would your code look like then?
For Example:
sorted_cards = Card.objects.all().extra(...).order_by(...)

I&#039;m quite new to all this and don&#039;t have a clue about sql and things like that. Your help is really appreciated.

Best
JacquesKnie</description>
		<content:encoded><![CDATA[<p>Hey Dmitry,<br />
Thanks for your reply, but I still don&#8217;t really get it. I have a model called Card, how would your code look like then?<br />
For Example:<br />
sorted_cards = Card.objects.all().extra(&#8230;).order_by(&#8230;)</p>
<p>I&#8217;m quite new to all this and don&#8217;t have a clue about sql and things like that. Your help is really appreciated.</p>
<p>Best<br />
JacquesKnie</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmitry</title>
		<link>http://blog.damontimm.com/django-hitcount-app-count-hits-views/comment-page-1/#comment-41136</link>
		<dc:creator>Dmitry</dc:creator>
		<pubDate>Sat, 18 Jun 2011 11:58:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.damontimm.com/?p=201#comment-41136</guid>
		<description>To render 1 page hitcount makes 2 identical SQL queries: 

First to render js:
&lt;code&gt;

&lt;/code&gt;

and second to get hitcount for object:
{% get_hit_count for object as hit_count %}

How can I reduce the number of queries?)</description>
		<content:encoded><![CDATA[<p>To render 1 page hitcount makes 2 identical SQL queries: </p>
<p>First to render js:<br />
<code></p>
<p></code></p>
<p>and second to get hitcount for object:<br />
{% get_hit_count for object as hit_count %}</p>
<p>How can I reduce the number of queries?)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmitry</title>
		<link>http://blog.damontimm.com/django-hitcount-app-count-hits-views/comment-page-1/#comment-41135</link>
		<dc:creator>Dmitry</dc:creator>
		<pubDate>Sat, 18 Jun 2011 11:52:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.damontimm.com/?p=201#comment-41135</guid>
		<description>Use something like this:
actions = Action.objects.all().extra(
          select={
              &#039;hit_count&#039;: &#039;SELECT hits FROM hitcount_hit_count as t \
                WHERE t.content_type_id = 13 \
                AND t.object_pk = actions_action.id&#039;,
          },).order_by(&quot;hit_count&quot;)

It works =)</description>
		<content:encoded><![CDATA[<p>Use something like this:<br />
actions = Action.objects.all().extra(<br />
          select={<br />
              &#8216;hit_count&#8217;: &#8216;SELECT hits FROM hitcount_hit_count as t \<br />
                WHERE t.content_type_id = 13 \<br />
                AND t.object_pk = actions_action.id&#8217;,<br />
          },).order_by(&#8220;hit_count&#8221;)</p>
<p>It works =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacquesknie</title>
		<link>http://blog.damontimm.com/django-hitcount-app-count-hits-views/comment-page-1/#comment-40075</link>
		<dc:creator>Jacquesknie</dc:creator>
		<pubDate>Fri, 03 Jun 2011 15:46:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.damontimm.com/?p=201#comment-40075</guid>
		<description>How would I order my counted objects by hits in a view? I really can&#039;t get my head around these generic relations!</description>
		<content:encoded><![CDATA[<p>How would I order my counted objects by hits in a view? I really can&#8217;t get my head around these generic relations!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: leon</title>
		<link>http://blog.damontimm.com/django-hitcount-app-count-hits-views/comment-page-1/#comment-35579</link>
		<dc:creator>leon</dc:creator>
		<pubDate>Fri, 25 Mar 2011 09:09:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.damontimm.com/?p=201#comment-35579</guid>
		<description>I&#039;m interested in using this to  count impressions of adds not just requests for them. I want my advertisers to know when there add has been &quot;seen&quot; not just requested.  I&#039;m planing on attaching the hit count to 2 js events - when the add in in  visible range and when an add has been display in a fading group of adds.  this will be perfect!  thanks :)</description>
		<content:encoded><![CDATA[<p>I&#8217;m interested in using this to  count impressions of adds not just requests for them. I want my advertisers to know when there add has been &#8220;seen&#8221; not just requested.  I&#8217;m planing on attaching the hit count to 2 js events &#8211; when the add in in  visible range and when an add has been display in a fading group of adds.  this will be perfect!  thanks :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam Starling</title>
		<link>http://blog.damontimm.com/django-hitcount-app-count-hits-views/comment-page-1/#comment-34197</link>
		<dc:creator>Sam Starling</dc:creator>
		<pubDate>Mon, 07 Mar 2011 15:02:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.damontimm.com/?p=201#comment-34197</guid>
		<description>I&#039;m using 1.2.5 - however, it&#039;s easily fixed by using the Javascript given on that Django page I linked originally. I hadn&#039;t realised that the function posted there overrides every AJAX POST and adds in the appropriate header, thus solving the problem!</description>
		<content:encoded><![CDATA[<p>I&#8217;m using 1.2.5 &#8211; however, it&#8217;s easily fixed by using the Javascript given on that Django page I linked originally. I hadn&#8217;t realised that the function posted there overrides every AJAX POST and adds in the appropriate header, thus solving the problem!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damon</title>
		<link>http://blog.damontimm.com/django-hitcount-app-count-hits-views/comment-page-1/#comment-33806</link>
		<dc:creator>Damon</dc:creator>
		<pubDate>Wed, 02 Mar 2011 15:46:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.damontimm.com/?p=201#comment-33806</guid>
		<description>Which version of Django does this fail with?  I haven&#039;t updated my web site that utilizes this lately so I may be behind in the Django parlance -- in fact, haven&#039;t done anything with this for a bit!  Feel bad too - need to get on that.</description>
		<content:encoded><![CDATA[<p>Which version of Django does this fail with?  I haven&#8217;t updated my web site that utilizes this lately so I may be behind in the Django parlance &#8212; in fact, haven&#8217;t done anything with this for a bit!  Feel bad too &#8211; need to get on that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam Starling</title>
		<link>http://blog.damontimm.com/django-hitcount-app-count-hits-views/comment-page-1/#comment-33802</link>
		<dc:creator>Sam Starling</dc:creator>
		<pubDate>Wed, 02 Mar 2011 14:33:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.damontimm.com/?p=201#comment-33802</guid>
		<description>I know nothing has been posted here for a while, but I&#039;ve just started using this. It&#039;s very useful, but the AJAX calls will fail when the CsrfViewMIddleware is installed in MIDDLEWARE_CLASSES (which it is by default in Django). 

To solve this, you need to make sure you include the appropriate CSRF Header in every AJAX request, which can be done as shown in the &lt;a href=&quot;http://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax&quot; rel=&quot;nofollow&quot;&gt;Django documentation&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>I know nothing has been posted here for a while, but I&#8217;ve just started using this. It&#8217;s very useful, but the AJAX calls will fail when the CsrfViewMIddleware is installed in MIDDLEWARE_CLASSES (which it is by default in Django). </p>
<p>To solve this, you need to make sure you include the appropriate CSRF Header in every AJAX request, which can be done as shown in the <a href="http://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax" rel="nofollow">Django documentation</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Friend</title>
		<link>http://blog.damontimm.com/django-hitcount-app-count-hits-views/comment-page-1/#comment-33043</link>
		<dc:creator>Friend</dc:creator>
		<pubDate>Mon, 21 Feb 2011 07:58:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.damontimm.com/?p=201#comment-33043</guid>
		<description>self.answer:

objects.extra + query.join</description>
		<content:encoded><![CDATA[<p>self.answer:</p>
<p>objects.extra + query.join</p>
]]></content:encoded>
	</item>
</channel>
</rss>

