This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Statistic for models


For install you can use pip:
pip install django-statistic


from django.db import models

class Authors(models.Model):
first_name = ....
last_name = ....

class Books(models.Model):
title = ....
author = models.ManyToManyField(Author)

from statistic import Statistic
from models import Authors, Books

def my_view(request):
book = Books.objects.get(...)

# Put object in statistic table

# Get statistic for object
statistic_for_object = Statistic.objects.get_statistic_for_object(book)

# Get statistic for model
statistic_for_model = Statistic.objects.get_statistic_for_model(Books, limit=50)

# Get statistic for models
statistic_for_models = Statistic.objects.get_statistic_for_model([Authors, Books], limit=50, shuffle=True)

RELATIVE_FOR_YEAR = 1 # Get relative year (Today is 2013, example get: 2012, 2013)
RELATIVE_FOR_MONTH = 3 # Get relative month (Today is 1'th January, example get: 2012.11, 2012.12, 2013.1)
RELATIVE_FOR_WEEK = 2 # Get relative week (Today is 13'th week of year, example get: 11, 12, 13 week of year)


For big data, you must use cache/crontab.
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-statistic-1.0.tar.gz (3.9 kB) Copy SHA256 Checksum SHA256 Source Aug 26, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting