actions, move parse_decimal
This commit is contained in:
parent
d50d242c45
commit
07dcc77950
7 changed files with 44 additions and 33 deletions
|
|
@ -1,6 +1,24 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# vi:si:et:sw=4:sts=4:ts=4
|
||||
import sys
|
||||
|
||||
from ox.django.shortcuts import render_to_json_response, get_object_or_404_json, json_response
|
||||
from django.conf import settings
|
||||
|
||||
from ox.django.shortcuts import render_to_json_response, json_response
|
||||
|
||||
|
||||
def autodiscover():
|
||||
#register api actions from all installed apps
|
||||
from django.utils.importlib import import_module
|
||||
from django.utils.module_loading import module_has_submodule
|
||||
for app in settings.INSTALLED_APPS:
|
||||
if app != 'api':
|
||||
mod = import_module(app)
|
||||
try:
|
||||
import_module('%s.views'%app)
|
||||
except:
|
||||
if module_has_submodule(mod, 'views'):
|
||||
raise
|
||||
|
||||
|
||||
def trim(docstring):
|
||||
|
|
@ -28,7 +46,6 @@ def trim(docstring):
|
|||
# Return a single string:
|
||||
return '\n'.join(trimmed)
|
||||
|
||||
|
||||
class ApiActions(dict):
|
||||
def __init__(self):
|
||||
def api(request):
|
||||
|
|
|
|||
|
|
@ -33,18 +33,6 @@ from pandora.archive import extract
|
|||
|
||||
from actions import actions
|
||||
|
||||
#register all api actions
|
||||
from django.utils.importlib import import_module
|
||||
from django.utils.module_loading import module_has_submodule
|
||||
for app in settings.INSTALLED_APPS:
|
||||
if app != 'api':
|
||||
mod = import_module(app)
|
||||
try:
|
||||
import_module('%s.views'%app)
|
||||
except:
|
||||
if module_has_submodule(mod, 'views'):
|
||||
raise
|
||||
|
||||
def api(request):
|
||||
if request.META['REQUEST_METHOD'] == "OPTIONS":
|
||||
response = HttpResponse('')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue