Changeset - acc1b1490e33
[Not reviewed]
0 1 0
Scott Bragg - 8 years ago 2016-06-13 10:46:13
jsbragg@scriptforge.org
Update css_class methods to use new vote scoring (removed VOTE_ZERO)
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
symposion/reviews/models.py
Show inline comments
...
 
@@ -174,16 +174,16 @@ class Review(models.Model):
 
                self.proposal.result.save()
 
        # in all cases we need to delete the review; let's do it!
 
        super(Review, self).delete()
 

	
 
    def css_class(self):
 
        return {
 
            self.VOTES.PLUS_TWO: "plus-two",
 
            self.VOTES.PLUS_ONE: "plus-one",
 
            self.VOTES.PLUS_ZERO: "plus-zero",
 
            self.VOTES.MINUS_ZERO: "minus-zero",
 
            self.VOTES.MINUS_ONE: "minus-one",
 
            self.VOTES.MINUS_TWO: "minus-two",
 
        }[self.vote]
 

	
 
    @property
 
    def section(self):
 
        return self.proposal.kind.section.slug
 

	
...
 
@@ -207,16 +207,16 @@ class LatestVote(models.Model):
 
        unique_together = [("proposal", "user")]
 
        verbose_name = _("latest vote")
 
        verbose_name_plural = _("latest votes")
 

	
 
    def css_class(self):
 
        return {
 
            self.VOTES.PLUS_TWO: "plus-two",
 
            self.VOTES.PLUS_ONE: "plus-one",
 
            self.VOTES.PLUS_ZERO: "plus-zero",
 
            self.VOTES.MINUS_ZERO: "minus-zero",
 
            self.VOTES.MINUS_ONE: "minus-one",
 
            self.VOTES.MINUS_TWO: "minus-two",
 
        }[self.vote]
 

	
 

	
 
class ProposalResult(models.Model):
 
    proposal = models.OneToOneField(ProposalBase, related_name="result", verbose_name=_("Proposal"))
 
    score = models.DecimalField(max_digits=5, decimal_places=2, default=Decimal("0.00"), verbose_name=_("Score"))
0 comments (0 inline, 0 general)