def dcattr_add(self, name, value, comment=""): a = dcattr( self, name=name, value=value, comment=comment, ) a.save() self.append_dcattr(a)
def _load_dcattrs(self): # as soon as we have a dcdocid we also have workdir() if not os.path.exists(self.workdir()): return for dcattr_file in os.listdir(self.workdir()): if re.match('.*\.dcattr$', dcattr_file): self.append_dcattr(dcattr(self, dcattrfilename=dcattr_file))