Remove unused function.

This commit is contained in:
Alexis Lahouze 2015-07-10 14:55:29 +02:00
parent 0e32f5f696
commit 3708fc637a

View File

@ -16,36 +16,19 @@
""" """
import dateutil.parser import dateutil.parser
from flask import json
from flask.ext.restful import Resource, fields, reqparse, marshal_with_field from flask.ext.restful import Resource, fields, reqparse, marshal_with_field
from sqlalchemy.orm.exc import NoResultFound from sqlalchemy.orm.exc import NoResultFound
from accountant import session_scope, session_aware from accountant import session_aware
from . import auth from .. import api_api
from .. import api, api_api
from ..models.accounts import Account from ..models.accounts import Account
from ..models.entries import Entry
from ..fields import Object from ..fields import Object
# TODO Alexis Lahouze 2015-06-13 Remove this function and use only time range
# based queries.
@api.route("/accounts/<account_id>/months")
@auth.login_required
def get_months(account_id):
with session_scope() as session:
query = Entry.get_months_for_account(session, account_id)
return json.dumps([{
"year": i.year,
"month": i.month.rjust(2, '0')
} for i in query.all()])
resource_fields = { resource_fields = {
'id': fields.Integer(default=None), 'id': fields.Integer(default=None),
'name': fields.String, 'name': fields.String,