Remove unused function.
This commit is contained in:
parent
0e32f5f696
commit
3708fc637a
@ -16,36 +16,19 @@
|
||||
"""
|
||||
import dateutil.parser
|
||||
|
||||
from flask import json
|
||||
from flask.ext.restful import Resource, fields, reqparse, marshal_with_field
|
||||
|
||||
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_api
|
||||
from .. import api_api
|
||||
|
||||
from ..models.accounts import Account
|
||||
from ..models.entries import Entry
|
||||
|
||||
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 = {
|
||||
'id': fields.Integer(default=None),
|
||||
'name': fields.String,
|
||||
|
Loading…
Reference in New Issue
Block a user