@csrf_exempt
def update_row(request, slug=None, ogc_fid=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 k in schema }
    try:
        payload = json.loads(request.body)
        for k in [x for x in payload if schema in x]:
            row[k] = payload[k]
    except:
        pass # just in case there's JSON in the payuload

    if ogc_fid is None:
        ogc_fid = row['OGC_FID']

    bbox = GEOSGeometry(ds.driver_instance.get_row(int(ogc_fid), geometry_format='wkt')['GEOMETRY']).envelope
    result = ds.driver_instance.update_row(int(ogc_fid), **row)
    dispatch.api_accessed.send(sender=DataResource, instance=ds, user=user)
    dispatch.features_updated.send(sender=DataResource, instance=ds, user=user, count=1, fid=ogc_fid, bbox=bbox)
    return json_or_jsonp(request, result)
dataset/ETHPy150Open hydroshare/hydroshare2/ga_resources/views/rest_data.py/update_row/swapped operands of `in`