Exemplo n.º 1
0
def async_users_export(job, data_format):
    instance = job.instance

    if data_format == 'csv':
        filename = 'users.csv'
    else:
        filename = 'users.json'

    file_obj = TemporaryFile()
    write_users(data_format, file_obj, instance)
    job.complete_with(filename, File(file_obj))
    job.save()
Exemplo n.º 2
0
def async_users_export(job, data_format):
    instance = job.instance

    if data_format == 'csv':
        filename = 'users.csv'
    else:
        filename = 'users.json'

    file_obj = TemporaryFile()
    write_users(data_format, file_obj, instance)
    job.complete_with(filename, File(file_obj))
    job.save()
Exemplo n.º 3
0
def users_json(request, instance):
    response = get_json_response('user_export.json')
    extra = _get_user_extra_args(request)
    write_users('json', response, instance, *extra)
    return response
Exemplo n.º 4
0
def users_csv(request, instance):
    "Return a user csv synchronously"
    response = get_csv_response('users.csv')
    extra = _get_user_extra_args(request)
    write_users('csv', response, instance, *extra)
    return response
Exemplo n.º 5
0
def users_json(request, instance):
    response = get_json_response('user_export.json')
    extra = _get_user_extra_args(request)
    write_users('json', response, instance, *extra)
    return response
Exemplo n.º 6
0
def users_csv(request, instance):
    "Return a user csv synchronously"
    response = get_csv_response('users.csv')
    extra = _get_user_extra_args(request)
    write_users('csv', response, instance, *extra)
    return response