(self, sketch_id, datasource_id)
return self.to_json(data_source)
Handles POST request to the resource.

        Args:
          sketch_id (int): Identifier for the Sketch the datasource belongs to.
          datasource_id (int): Identifier for the datasource.

        Returns:
            A sketch in JSON (instance of flask.wrappers.Response)
Handles POST request to the resource.
Handles POST request to the resource .
def post(self, sketch_id, datasource_id):
        """Handles POST request to the resource.

        Args:
          sketch_id (int): Identifier for the Sketch the datasource belongs to.
          datasource_id (int): Identifier for the datasource.

        Returns:
            A sketch in JSON (instance of flask.wrappers.Response)
        """
        self._verify_sketch_and_datasource(sketch_id, datasource_id)

        data_source = DataSource.query.get(datasource_id)
        changed = False

        form = request.json
        if not form:
            form = request.data

        provider = form.get('provider')
        if provider:
            changed = True
            data_source.provider = provider

        context = form.get('context')
        if context:
            changed = True
            data_source.context = context

        if changed:
            db_session.add(data_source)
            db_session.commit()

        return self.to_json(data_source)
def post ( self , sketch_id , datasource_id ) : self . _verify_sketch_and_datasource ( sketch_id , datasource_id ) data_source = DataSource . query . get ( datasource_id ) changed = False form = request . json if not form : form = request . data provider = form . get ( 'provider' ) if provider : changed = True data_source . provider = provider context = form . get ( 'context' ) if context : changed = True data_source . context = context if changed : db_session . add ( data_source ) db_session . commit ( ) return self . to_json ( data_source )