comparison gpp/downloads/models.py @ 182:5c889b587416

Fixing #64. Updating all model save() methods to use *args and **kwargs. Django 1.2 has new keyword arguments.
author Brian Neal <bgneal@gmail.com>
date Sun, 28 Mar 2010 21:41:11 +0000
parents 48621ba5c385
children 0e4961833cdf
comparison
equal deleted inserted replaced
181:500e5875a306 182:5c889b587416
70 70
71 @models.permalink 71 @models.permalink
72 def get_absolute_url(self): 72 def get_absolute_url(self):
73 return ('downloads-details', [str(self.id)]) 73 return ('downloads-details', [str(self.id)])
74 74
75 def save(self, force_insert=False, force_update=False): 75 def save(self, *args, **kwargs):
76 self.html = site_markup(self.description) 76 self.html = site_markup(self.description)
77 super(Download, self).save(force_insert, force_update) 77 super(Download, self).save(*args, **kwargs)
78 78
79 def vote(self, vote_value): 79 def vote(self, vote_value):
80 """receives a vote_value and updates internal score accordingly""" 80 """receives a vote_value and updates internal score accordingly"""
81 total_score = self.average_score * self.total_votes 81 total_score = self.average_score * self.total_votes
82 total_score += vote_value 82 total_score += vote_value