This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 756533 - Move actioncounters test model into own package.
This prevents the creation of the table in non test environments.
- Loading branch information
Showing
5 changed files
with
22 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from django.db import models | ||
|
||
from ..fields import ActionCounterField | ||
|
||
|
||
class TestModel(models.Model): | ||
title = models.CharField(max_length=255, blank=False, unique=True) | ||
|
||
likes = ActionCounterField() | ||
views = ActionCounterField(max_total_per_unique=5) | ||
frobs = ActionCounterField(min_total_per_unique=-5) | ||
boogs = ActionCounterField(min_total_per_unique=-5, max_total_per_unique=5) | ||
|
||
def __unicode__(self): | ||
return unicode(self.pk) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters