have a look at http://svn.zyons.python-hosting.com/trunk/zilbo/common/counter/and the blog entries I wrote about this yesterday: http://zyons.com/blog/status/a-better-stat-page/ and http://zyons.com/blog/status/where-have-you-been/it is a more general approach than what you propose, as it tracks mu
What about this? (disclaimer: I'm just starting in Django)
First, we create a model where you simply have the name of the view
and the number of times hitted. This model increases it's "counter"
variable each time it is saved.
class NbViews(models.Model)
viewname=models.TextField(maxlength=30
I'm interested in what the community suggests on this topic, as it's
something I'd like to implement as well. However, one word of advice if
you're using MySQL and its Query Cache... try to keep the "views"
column outside of your models table since updating that table on every
hit would basi
Any suggestions on how I could track how many times an object has
loaded and/or been clicked?
I mean, obviously in my model I'd need something like
class Item(models.Model):
views = IntegerField()
but how would I update views when Item was loaded on a page?
--~--~-~--~~-
4 matches
Mail list logo