Mercurial > farol > farolluz
diff farolluz/cvrf.py @ 6:633ebfcff0d0
Add a method to request a Document ID
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Mon, 06 Oct 2014 11:39:59 +0200 |
parents | d47e1164740f |
children | c924c15bd110 |
line wrap: on
line diff
--- a/farolluz/cvrf.py Mon Oct 06 11:39:38 2014 +0200 +++ b/farolluz/cvrf.py Mon Oct 06 11:39:59 2014 +0200 @@ -65,6 +65,9 @@ def addAlias(self, alias): self._aliases.append(alias) + def getId(self): + return self._id + def validate(self): if not self._id: raise ValidationError('Document ID cannot be left empty') @@ -92,6 +95,9 @@ def setGenerator(self, generator): self._generator = generator + def getId(self): + return self._identification.getId() + def validate(self): if self._identification is None: raise ValidationError('Document Tracking needs to have an Identification') @@ -978,6 +984,12 @@ return note return None + def getDocId(self): + if self._tracking is not None: + return self._tracking.getId() + # Make up something ... + return self._title.lower() + def validate(self): if not self._title: raise ValidationError('Document Title cannot be empty')