def clean_caseversions(self):
        """
        Make sure all the ids for the cases are valid and populate
        self.cleaned_data with the real objects.
        """
        caseversions = dict((unicode(x.id), x) for x in
            model.CaseVersion.objects.filter(
                pk__in=self.cleaned_data["caseversions"]))
        try:
            return [caseversions[x] for x in self.cleaned_data["caseversions"]]
        except __HOLE__ as e:
            raise ValidationError("Not a valid caseversion for this tag.")
dataset/ETHPy150Open mozilla/moztrap/moztrap/view/manage/tags/forms.py/TagForm.clean_caseversions