##// END OF EJS Templates
Small changes to queries
neko259 -
r395:f18b32bd default
parent child Browse files
Show More
@@ -136,11 +136,6 b' class PostManager(models.Manager):'
136 136
137 137 return thread
138 138
139 def exists(self, post_id):
140 posts = self.filter(id=post_id)
141
142 return posts.count() > 0
143
144 139 def get_thread_page_count(self, tag=None):
145 140 if tag:
146 141 threads = self.filter(thread=None, tags=tag)
@@ -56,7 +56,7 b' class User(models.Model):'
56 56 tags = self.fav_tags.annotate(Count('threads')) \
57 57 .filter(threads__count__gt=0).order_by('name')
58 58
59 if tags:
59 if tags.exists():
60 60 cache.set(cache_key, tags, settings.CACHE_TIMEOUT)
61 61
62 62 return tags
General Comments 0
You need to be logged in to leave comments. Login now