QuickstartΒΆ
After you install the package and update your settings
and urls
files, let create a simple report.
For example, you have an Article
model and you’d like to know how many new articles created each day.
Add QuickReport
inner class to your model as below.
class Article(models.Model):
class Status:
DRAFT = 0
PUBLISHED = 1
CHOICES = [(DRAFT, "Draft"), (PUBLISHED, "Published")]
title = models.CharField(max_length=190)
body = models.TextField()
slug = models.SlugField(max_length=190)
status = models.IntegerField(choices=Status.CHOICES, default=Status.DRAFT)
author = models.ForeignKey(User)
created_at = models.DateTimeField(default=timezone.now)
class QuickReport():
date_field = "created_at"
Visit http://example.com/reports/
and find your model in left sidebar.
If you click on that, you will see the chart similar to below