Refactor rest_api app and the method end points are registered. All apps API URL endpoints are now registered under the 'rest_api' namespace.

This commit is contained in:
Roberto Rosario
2015-08-06 02:50:14 -04:00
parent 1fa859a0c3
commit ea02172a82
8 changed files with 64 additions and 73 deletions

View File

@@ -1,19 +1,21 @@
from __future__ import unicode_literals
from django import apps
from django.utils.translation import ugettext_lazy as _
from common import menu_tools
from common import MayanAppConfig, menu_tools
from .classes import APIEndPoint
from .links import link_api, link_api_documentation
class RESTAPIApp(apps.AppConfig):
class RESTAPIApp(MayanAppConfig):
app_url = 'api'
name = 'rest_api'
verbose_name = _('REST API')
def ready(self):
APIEndPoint('rest_api')
super(RESTAPIApp, self).ready()
APIEndPoint(app=self, version_string='1')
menu_tools.bind_links(links=(link_api, link_api_documentation))