def obj_create(self, bundle, request=None, **kwargs):
        request = request or bundle.request

        pv_required_msg = str("The 'productversions' key must exist, " +
                          "must be a list, and the list must contain " +
                          "at least one entry.")
        # pull the productversions off, they don't exist yet
        try:
            productversions = bundle.data.pop('productversions')
            if not isinstance(productversions, list):
                raise ImmediateHttpResponse(
                    response=http.HttpBadRequest(pv_required_msg))
            if not len(productversions):
                raise ImmediateHttpResponse(
                    response=http.HttpBadRequest(pv_required_msg))

            bundle.data["productversions"] = []
        except KeyError:
            raise ImmediateHttpResponse(
                response=http.HttpBadRequest(pv_required_msg))

        # create the product
        updated_bundle = super(ProductResource, self).obj_create(
            bundle=bundle, request=request, **kwargs)

        # create the productversions
        for pv in productversions:
            ProductVersion.objects.get_or_create(
                product=updated_bundle.obj, **pv)

        return updated_bundle
Constructor.
dataset/ETHPy150Open mozilla/moztrap/moztrap/model/core/api.py/ProductResource.obj_create--crossover with--dataset/ETHPy150Open mrjoes/flask-admin/flask_admin/form/rules.py/Text.__init__