Skip to content

Commit

Permalink
getting rid of unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
jaesivsm committed Aug 30, 2018
1 parent 72ca8f7 commit c590ecf
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions jarr/controllers/article.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import logging
from collections import Counter
from datetime import timedelta

import sqlalchemy
from sqlalchemy import func, cast
from sqlalchemy.dialects.postgresql import TSVECTOR
from werkzeug.exceptions import Unauthorized, Forbidden
Expand Down Expand Up @@ -100,24 +98,6 @@ def update(self, filters, attrs, return_objs=False, commit=True):
raise Forbidden("no right on cat %r" % cat.id)
return super().update(filters, attrs, return_objs, commit)

def get_history(self, year=None, month=None):
"Sort articles by year and month."
articles_counter = Counter()
articles = self.read()
if year is not None:
articles = articles.filter(
sqlalchemy.extract('year', Article.date) == year)
if month is not None:
articles = articles.filter(
sqlalchemy.extract('month', Article.date) == month)
articles = articles.order_by('date')
for article in articles.all():
if year is not None:
articles_counter[article.date.month] += 1
else:
articles_counter[article.date.year] += 1
return articles_counter, articles

def remove_from_cluster(self, article):
"""Removes article with id == article_id from the cluster it belongs to
If it's the only article of the cluster will delete the cluster
Expand Down

0 comments on commit c590ecf

Please sign in to comment.