def save(self, *args, **kwargs):
if not self.term in self.DCELEMENT_CODE_MAP:<EOL><INDENT>raise ValueError('<STR_LIT>'+self.DCTERM_CODE_MAP[self.term]+'<STR_LIT>')<EOL><DEDENT>changed = False<EOL>if self.pk:<EOL><INDENT>db_self = QualifiedDublinCoreElement.objects.get(pk=self.pk)<EOL>if self.term != db_self.term:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if self.content != db_self.content:<EOL><INDENT>changed = True<EOL><DEDENT>if self.qualifier != db_self.qualifier:<EOL><INDENT>changed = True<EOL><DEDENT>if changed:<EOL><INDENT>hist = QualifiedDublinCoreElementHistory()<EOL>hist.qdce = self<EOL>hist.object_id = db_self.object_id<EOL>hist.content_type = db_self.content_type<EOL>hist.term = db_self.term<EOL>hist.qualifier = db_self.qualifier<EOL>hist.content  = db_self.content<EOL>hist.save()<EOL><DEDENT><DEDENT>super(QualifiedDublinCoreElement, self).save(*args, **kwargs)<EOL>obj = self.content_object<EOL>if hasattr(obj, '<STR_LIT>'):<EOL><INDENT>obj._save_dc_xml_file()<EOL><DEDENT>
Make sure that the term is valid.
        If changed, create a QualifiedDublinCoreElementHistory object and save it.