0.0.1 init, main page prepare
This commit is contained in:
23
BaseModels/api/api_inter.py
Normal file
23
BaseModels/api/api_inter.py
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
def check_and_get_specific_output_format(obj, data=None, filename=None):
|
||||
|
||||
if obj.request.query_params and 'output_format' in obj.request.query_params and obj.request.query_params['output_format'] == 'xlsx':
|
||||
|
||||
if not data:
|
||||
serializer = obj.get_serializer(obj.get_queryset(), many=True)
|
||||
data = serializer.data
|
||||
|
||||
from .api_export_xls import xls_export
|
||||
return xls_export(data, filename)
|
||||
|
||||
return None
|
||||
|
||||
def fix_txt_for_use_in_interlinks(txt):
|
||||
txt = txt.replace('/', ' ')
|
||||
txt = txt.replace('?', ' ')
|
||||
txt = txt.replace(';', ' ')
|
||||
txt = txt.replace(',', ' ')
|
||||
txt = txt.replace('+', ' ')
|
||||
txt = txt.replace(':', ' ')
|
||||
return txt
|
||||
Reference in New Issue
Block a user