@PostOnly
def flag_org(request):
    try:
        org_id = getattr(request.POST, 'org_id')
        org = Org.objects.get(id = org_id)
    except __HOLE__, ObjectDoesNotExist:
        return json_error(CANNOT_FLAG_ERROR)

    # TODO: so, uh, we need to figure out if the current user is authorized to do this?
    org.flagged = True
    org.save()
    cache.bust_on_handle(org, org.handle, False)
    return json_response({'result' : True})
dataset/ETHPy150Open jumoconnect/openjumo/jumodjango/org/ajax/views.py/flag_org