

def obj_update(self, bundle, request=None, **kwargs):
    "Oversee updating of product.\n        If this were RESTful, it would remove all existing versions and add\n        the requested versions. But this isn't restful, it just adds the\n        version if it doesn't exist already.\n        "
    productversions = bundle.data.pop('productversions', [])
    bundle.data['productversions'] = []
    updated_bundle = super(ProductResource, self).obj_update(bundle=bundle, request=request, **kwargs)
    for pv in productversions:
        ProductVersion.objects.get_or_create(product=updated_bundle.obj, **pv)
    return updated_bundle

dataset/ETHPy150Open mozilla/moztrap/moztrap/model/core/api.py ProductResource.obj_update/original