-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from shanbay/feature-support-vote-down
Feature support vote down
- Loading branch information
Showing
15 changed files
with
280 additions
and
144 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
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
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
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 |
---|---|---|
@@ -1,23 +1,11 @@ | ||
from django.db import models | ||
from vote.managers import VotableManager | ||
from vote.models import VoteModel | ||
|
||
|
||
# Create your models here. | ||
class Comment(models.Model): | ||
class Comment(VoteModel): | ||
user_id = models.BigIntegerField() | ||
content = models.TextField() | ||
num_vote = models.IntegerField(default=0) | ||
create_at = models.DateTimeField(auto_now_add=True) | ||
update_at = models.DateTimeField(auto_now=True) | ||
|
||
votes = VotableManager() | ||
|
||
|
||
class CustomVoteComment(models.Model): | ||
user_id = models.BigIntegerField() | ||
content = models.TextField() | ||
num_vote = models.PositiveIntegerField(default=0) | ||
create_at = models.DateTimeField(auto_now_add=True) | ||
update_at = models.DateTimeField(auto_now=True) | ||
|
||
custom_votes = VotableManager(extra_field='num_vote') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
VERSION = (2, 1, 3) | ||
VERSION = (2, 1, 4) | ||
|
||
default_app_config = 'vote.apps.VoteAppConfig' |
Oops, something went wrong.