main/views.py
def public_api(request, username, id_string):
    """
    Returns public information about the form as JSON
    """

    xform = get_object_or_404(XForm,
                              user__username=username, id_string=id_string)

    _DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S'
    exports = {'username': xform.user.username,
               'id_string': xform.id_string,
               'bamboo_dataset': xform.bamboo_dataset,
               'shared': xform.shared,
               'shared_data': xform.shared_data,
               'downloadable': xform.downloadable,
               'is_crowd_form': xform.is_crowd_form,
               'title': xform.title,
               'date_created': xform.date_created.strftime(_DATETIME_FORMAT),
               'date_modified': xform.date_modified.strftime(_DATETIME_FORMAT),
               'uuid': xform.uuid,
               }
    response_text = json.dumps(exports)
    return HttpResponse(response_text, mimetype='application/json')

    Returns public information about the form as JSON
    
Returns public information about the form as JSON
Returns public information about the form as JSON
def public_api(request, username, id_string):
    xform = get_object_or_404(XForm,
                              user__username=username, id_string=id_string)
    _DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S'
    exports = {'username': xform.user.username,
               'id_string': xform.id_string,
               'bamboo_dataset': xform.bamboo_dataset,
               'shared': xform.shared,
               'shared_data': xform.shared_data,
               'downloadable': xform.downloadable,
               'is_crowd_form': xform.is_crowd_form,
               'title': xform.title,
               'date_created': xform.date_created.strftime(_DATETIME_FORMAT),
               'date_modified': xform.date_modified.strftime(_DATETIME_FORMAT),
               'uuid': xform.uuid,
               }
    response_text = json.dumps(exports)
    return HttpResponse(response_text, mimetype='application/json')
def public_api ( request , username , id_string ) : xform = get_object_or_404 ( XForm , user__username = username , id_string = id_string ) _DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S' exports = { 'username' : xform . user . username , 'id_string' : xform . id_string , 'bamboo_dataset' : xform . bamboo_dataset , 'shared' : xform . shared , 'shared_data' : xform . shared_data , 'downloadable' : xform . downloadable , 'is_crowd_form' : xform . is_crowd_form , 'title' : xform . title , 'date_created' : xform . date_created . strftime ( _DATETIME_FORMAT ) , 'date_modified' : xform . date_modified . strftime ( _DATETIME_FORMAT ) , 'uuid' : xform . uuid , } response_text = json . dumps ( exports ) return HttpResponse ( response_text , mimetype = 'application/json' )
Returns public information about the form as JSON
Returns public information about the form as JSON
"""
    Returns public information about the form as JSON
    """
request
username
id_string