add a 'fullid' property to get 'ID@backend'
This commit is contained in:
parent
379083d2d7
commit
f6c2edc64f
1 changed files with 6 additions and 2 deletions
|
|
@ -21,13 +21,13 @@
|
|||
from weboob.tools.misc import iter_fields
|
||||
|
||||
|
||||
__all__ = ['FieldNotFound', 'IBaseCap', 'NotAvailable', 'NotLoaded',
|
||||
__all__ = ['FieldNotFound', 'IBaseCap', 'NotAvailable', 'NotLoaded',
|
||||
'CapBaseObject']
|
||||
|
||||
|
||||
class FieldNotFound(Exception):
|
||||
def __init__(self, obj, field):
|
||||
Exception.__init__(self,
|
||||
Exception.__init__(self,
|
||||
u'Field "%s" not found for object %s' % (field, obj))
|
||||
|
||||
|
||||
|
|
@ -72,6 +72,10 @@ class CapBaseObject(object):
|
|||
self.id = id
|
||||
self.backend = backend
|
||||
|
||||
@property
|
||||
def fullid(self):
|
||||
return '%s@%s' % (self.id, self.backend)
|
||||
|
||||
def add_field(self, name, type, value=NotLoaded):
|
||||
"""
|
||||
Add a field in list, which needs to be of type @type.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue