Mercurial > public > sg101
comparison gpp/downloads/models.py @ 14:7b6540b185d9
Added get_absolute_url() for my comments. Had to add a get_absolute_url() function for downloads in the process.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 18 Apr 2009 19:14:17 +0000 |
parents | dbd703f7d63a |
children | a5f27f25fa52 |
comparison
equal
deleted
inserted
replaced
13:777451a98f9d | 14:7b6540b185d9 |
---|---|
65 public_objects = PublicDownloadManager() | 65 public_objects = PublicDownloadManager() |
66 | 66 |
67 def __unicode__(self): | 67 def __unicode__(self): |
68 return self.title | 68 return self.title |
69 | 69 |
70 @models.permalink | |
71 def get_absolute_url(self): | |
72 return ('downloads-download', [str(self.id)]) | |
73 | |
70 def save(self, force_insert=False, force_update=False): | 74 def save(self, force_insert=False, force_update=False): |
71 html = render_to_string('downloads/markdown.html', {'data': self.description}) | 75 html = render_to_string('downloads/markdown.html', {'data': self.description}) |
72 self.html = html.strip() | 76 self.html = html.strip() |
73 super(Download, self).save(force_insert, force_update) | 77 super(Download, self).save(force_insert, force_update) |
74 | 78 |