def obj_create(self, bundle, request=None, **kwargs):
        """
        Add one Data to a Dataset.
        """
        dataset = self.get_dataset_from_kwargs(bundle, **kwargs)

        self.validate_bundle_data(bundle, request, dataset)

        if 'external_id' in bundle.data:
            external_id = bundle.data['external_id']
        elif 'external_id' in kwargs:
            external_id = kwargs['external_id']
        else:
            external_id = None

        # Because users may have authenticated via headers the request.user may
        # not be a full User instance. To be sure, we fetch one.
        user = UserProxy.objects.get(id=request.user.id)

        try:
            row = dataset.add_row(user, bundle.data['data'], external_id=external_id)
        except DatasetLockedError:
            raise ImmediateHttpResponse(response=http.HttpForbidden(_('Dataset is currently locked by another process.')))

        bundle.obj = SolrObject(row)

        return bundle
dataset/ETHPy150Open pandaproject/panda/panda/api/data.py/DataResource.obj_create/original