def update_metadata(context, request): """Store new metadata for an existing file. Example request using the ``curl`` command:: curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X PUT -d '{"description": "Super knife", "title": "A knife", "asset_ids": [1], "room_id": null}' http://localhost:6543/d/1/files/1/@@metadata """ adict = get_json_or_raise(request) return context.action.update_metadata(context.__name__, adict)
def update_metadata(context, request): """Store new metadata for an existing file. Example request using the ``curl`` command:: curl -i -H 'Content-Type: application/json' -H 'Accept: application/json' -X PUT -d '{"description": "Super knife", "asset_id": 1, "room_id": null, "user_id": 2}' http://localhost:6543/d/1/files/1/@@metadata """ adict = get_json_or_raise(request) orchestrator = get_orchestrator(context, request) action = orchestrator.get_action(context.namespace) return action.update_metadata(context.__name__, adict)
def update_metadata(context, request): adict = get_json_or_raise(request) orchestrator = request.registry.settings['keepluggable'] action = orchestrator.files_action_cls(orchestrator, context.namespace) return action.update_metadata(context.__name__, adict)