Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add field to make it possible to exclude a blog from the toplists, used

for special blogs that aren't personal, such as site-feeds.
  • Loading branch information...
commit bccafe36d7f243190ef1f1124239598ced834dbb 1 parent a32a97b
Magnus Hagander authored
Showing with 7 additions and 2 deletions.
  1. +6 −2 generator.py
  2. +1 −0  hamnadmin/register/models.py
8 generator.py
View
@@ -87,7 +87,9 @@ def Generate(self):
SELECT planet.feeds.name,blogurl,feedurl,count(*),planet.teams.name,planet.teams.teamurl,NULL FROM planet.feeds
INNER JOIN planet.posts ON planet.feeds.id=planet.posts.feed
LEFT JOIN planet.teams ON planet.teams.id=planet.feeds.team
-WHERE age(dat) < '1 month' AND approved AND NOT hidden GROUP BY planet.feeds.name,blogurl,feedurl,planet.teams.name,teamurl ORDER BY 4 DESC,1 LIMIT 20
+WHERE age(dat) < '1 month' AND approved AND NOT hidden
+AND NOT excludestats
+GROUP BY planet.feeds.name,blogurl,feedurl,planet.teams.name,teamurl ORDER BY 4 DESC,1 LIMIT 20
""")
self.topposters = [PlanetFeed(feed) for feed in c.fetchall()]
@@ -98,7 +100,9 @@ def Generate(self):
planet.feeds
INNER JOIN planet.posts ON planet.feeds.id=planet.posts.feed
INNER JOIN planet.teams ON planet.teams.id=planet.feeds.team
-WHERE age(dat) < '1 month' AND approved AND NOT hidden GROUP BY planet.teams.name, teamurl ORDER BY 7 DESC, 1 LIMIT 10""")
+WHERE age(dat) < '1 month' AND approved AND NOT hidden
+AND NOT excludestats
+GROUP BY planet.teams.name, teamurl ORDER BY 7 DESC, 1 LIMIT 10""")
self.topteams = [PlanetFeed(feed) for feed in c.fetchall()]
if len(self.topteams) < 2: self.topteams = []
1  hamnadmin/register/models.py
View
@@ -25,6 +25,7 @@ class Blog(models.Model):
authorfilter = models.CharField(max_length=255,default='',blank=True)
team = models.ForeignKey(Team,db_column='team', blank=True, null=True)
twitteruser = models.CharField(max_length=255, default='', blank=True)
+ excludestats = models.BooleanField(null=False, blank=False, default=False)
def __unicode__(self):
return "%s (%s)" % (self.name, self.feedurl)
Please sign in to comment.
Something went wrong with that request. Please try again.