def validate(self): types = { 1: self.dialect.nuxeo_imgs, 2: self.dialect.nuxeo_videos, 3: self.dialect.nuxeo_audio } for doc in types[self.type].values(): if doc.title == self.title or LetterMapper().compare( self.title, doc.title): self.doc = doc break if Item.validate(self): self.file_validate() self.recorder_validate() self.validate_int(self.shared, "fvm:shared") self.validate_text(self.description, "dc:description") self.contributor_validate(self.contributor, "fvm:source") self.status_validate() else: print("!!" + self.title) print(len(types[self.type].values()))
def validate(self): self.doc = self.dialect.nuxeo_categories.get(self.id) Item.validate(self)