api/study_api.py
def delete_field(study_id=None):
    """Deletes the specified Custom Field. Expects field in the request body."""
    study = Study.objects.get(pk=study_id)
    field = request.values.get('field', None)
    if field:
        try:
            study_field = StudyField.objects.get(study=study, id=field)
        except StudyField.DoesNotExist:
            study_field = None

        try:
            if study_field:
                study_field.delete()
        except ProtectedError:
            flash("This field can not be removed because it is already in use", 'danger')

    return redirect('/study_fields/{:d}'.format(study.id))
Deletes the specified Custom Field. Expects field in the request body.
Deletes the specified Custom Field. Expects field in the request body.
Deletes the specified Custom Field . Expects field in the request body .
def delete_field(study_id=None):
    study = Study.objects.get(pk=study_id)
    field = request.values.get('field', None)
    if field:
        try:
            study_field = StudyField.objects.get(study=study, id=field)
        except StudyField.DoesNotExist:
            study_field = None
        try:
            if study_field:
                study_field.delete()
        except ProtectedError:
            flash("This field can not be removed because it is already in use", 'danger')
    return redirect('/study_fields/{:d}'.format(study.id))
def delete_field ( study_id = None ) : study = Study . objects . get ( pk = study_id ) field = request . values . get ( 'field' , None ) if field : try : study_field = StudyField . objects . get ( study = study , id = field ) except StudyField . DoesNotExist : study_field = None try : if study_field : study_field . delete ( ) except ProtectedError : flash ( "This field can not be removed because it is already in use" , 'danger' ) return redirect ( '/study_fields/{:d}' . format ( study . id ) )
Deletes the specified Custom Field.
Deletes the specified Custom Field .
"""Deletes the specified Custom Field. Expects field in the request body."""
study_id