comparison farolluz/cvrf.py @ 8:cb8b2a196f0b

Allow Name and Organization in anAcknowledgment to be plural
author Benoît Allard <benoit.allard@greenbone.net>
date Wed, 08 Oct 2014 12:43:34 +0200
parents c924c15bd110
children db2a02fff101
comparison
equal deleted inserted replaced
7:c924c15bd110 8:cb8b2a196f0b
229 if not self._description: 229 if not self._description:
230 raise ValidationError('A Reference must contain a description') 230 raise ValidationError('A Reference must contain a description')
231 231
232 232
233 class CVRFAcknowledgment(object): 233 class CVRFAcknowledgment(object):
234 def __init__(self, name=None, organization=None, description=None, 234 def __init__(self, names=[], organizations=[], description=None,
235 url=None): 235 url=None):
236 self._name = name 236 self._names = names
237 self._organization = organization 237 self._organizations = organizations
238 self._description = description 238 self._description = description
239 self._url = url 239 self._url = url
240 240
241 def getTitle(self): 241 def getTitle(self):
242 return "%s - %s" % (self._name, self._organization) 242 return "%s - %s" % (', '.join(self._names),
243 243 ', '.join(self._organizations))
244 def validate(self): 244
245 if (not self._name) and (not self._organization) and (not self._description): 245 def validate(self):
246 if (not self._names) and (not self._organizations) and (not self._description):
246 raise ValidationError('An Acknowledgment must have at least a Name, an Organization or a Description') 247 raise ValidationError('An Acknowledgment must have at least a Name, an Organization or a Description')
247 248
248 249
249 class CVRFProductTree(object): 250 class CVRFProductTree(object):
250 def __init__(self): 251 def __init__(self):
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)