@csrf_exempt
def add_row(request, slug=None, *args, **kwargs):
    ds = get_object_or_404(DataResource, slug=slug)
    user = authorize(request, ds, edit=True)

    schema = {k for k in ds.driver_instance.schema()}
    row = {k: v for k, v in request.REQUEST.items() if schema in k}

    try:
        payload = json.loads(request.body)
        for k in [x for x in payload if x in schema]:
            row[k] = payload[k]
    except:
        pass # just in case there's JSON in the payuload

    new_rec = ds.driver_instance.add_row(**row)
    bbox = GEOSGeometry(row['GEOMETRY']).envelope

    dispatch.api_accessed.send(sender=DataResource, instance=ds, user=user)
    dispatch.features_created.send(sender=DataResource, instance=ds, user=user, count=1, bbox=bbox)
    return json_or_jsonp(request, new_rec, code=201)
dataset/ETHPy150Open hydroshare/hydroshare2/ga_resources/views/rest_data.py/add_row/swapped operands of `in`