Mercurial > public > sg101
comparison gpp/downloads/models.py @ 190:0e4961833cdf
Added some select_related's to downloads.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 01 Apr 2010 01:57:01 +0000 |
parents | 5c889b587416 |
children | 341759e1cda1 |
comparison
equal
deleted
inserted
replaced
189:db202792d9f5 | 190:0e4961833cdf |
---|---|
41 | 41 |
42 | 42 |
43 class PublicDownloadManager(models.Manager): | 43 class PublicDownloadManager(models.Manager): |
44 """The manager for all public downloads.""" | 44 """The manager for all public downloads.""" |
45 def get_query_set(self): | 45 def get_query_set(self): |
46 return super(PublicDownloadManager, self).get_query_set().filter(is_public=True) | 46 return super(PublicDownloadManager, self).get_query_set().filter( |
47 is_public=True).select_related() | |
47 | 48 |
48 | 49 |
49 class Download(models.Model): | 50 class Download(models.Model): |
50 """Model to represent a download.""" | 51 """Model to represent a download.""" |
51 title = models.CharField(max_length=128) | 52 title = models.CharField(max_length=128) |