Package gen :: Package lib :: Module privacybase :: Class PrivacyBase
[frames] | no frames]

Class PrivacyBase

source code


Base class for privacy-aware objects.

Instance Methods
 
__init__(self, source=None)
Initialize a PrivacyBase.
source code
 
serialize(self)
Convert the object to a serialized tuple of data.
source code
 
unserialize(self, data)
Convert a serialized tuple of data to an object.
source code
 
set_privacy(self, val)
Set or clears the privacy flag of the data.
source code
bool
get_privacy(self)
Return the privacy level of the data.
source code
Method Details

__init__(self, source=None)
(Constructor)

source code 

Initialize a PrivacyBase.

If the source is not None, then object is initialized from values of the source object.

Parameters:
  • source (PrivacyBase) - Object used to initialize the new object

set_privacy(self, val)

source code 

Set or clears the privacy flag of the data.

Parameters:
  • val (bool) - value to assign to the privacy flag. True indicates that the record is private, False indicates that it is public.

get_privacy(self)

source code 

Return the privacy level of the data.

Returns: bool
True indicates that the record is private