Back to index

plone3  3.1.7
Public Member Functions | Private Attributes
PluggableAuthService.UserPropertySheet.UserPropertySheet Class Reference

List of all members.

Public Member Functions

def __init__
def getId
def hasProperty
def getProperty
def getPropertyType
def propertyInfo
def propertyMap
def propertyIds
def propertyValues
def propertyItems

Private Attributes

 _id
 _schema
 _properties

Detailed Description

Model a single, read-only set of properties about a user.

o Values for the sheet are passed as keyword args to the c'tor.

o The schema for the sheet may be passed into the c'tor explicitly
  as a sequence of (id, type) tuples;  if not passed, the c'tor will
  guess the schema from the keyword args.

Definition at line 88 of file UserPropertySheet.py.


Constructor & Destructor Documentation

def PluggableAuthService.UserPropertySheet.UserPropertySheet.__init__ (   self,
  id,
  schema = None,
  kw 
)

Definition at line 99 of file UserPropertySheet.py.

00099 
00100     def __init__( self, id, schema=None, **kw ):
00101 
00102         self._id = id
00103 
00104         if schema is None:
00105             schema = _guessSchema( kw )
00106 
00107         self._schema = tuple( schema )
00108         self._properties = {}
00109 
00110         for id, ptype in schema:
00111 
00112             value = kw.get( id )
00113 
00114             if ptype == 'lines':
00115                 if value is not None:
00116                     value = tuple( value )
00117 
00118             self._properties[ id ] = value


Member Function Documentation

See IPropertySheet.

Definition at line 122 of file UserPropertySheet.py.

00122 
00123     def getId( self ):
00124 
00125         """ See IPropertySheet.
00126         """
00127         return self._id

def PluggableAuthService.UserPropertySheet.UserPropertySheet.getProperty (   self,
  id,
  default = None 
)
See IPropertySheet.

Definition at line 134 of file UserPropertySheet.py.

00134 
00135     def getProperty( self, id, default=None ):
00136 
00137         """ See IPropertySheet.
00138         """
00139         return self._properties.get( id, default )

Here is the caller graph for this function:

See IPropertySheet.

Definition at line 140 of file UserPropertySheet.py.

00140 
00141     def getPropertyType( self, id ):
00142 
00143         """ See IPropertySheet.
00144         """
00145         found = [ x[1] for x in self._schema if x[0] == id ]
00146 
00147         return found and found[0] or None

See IPropertySheet.

Definition at line 128 of file UserPropertySheet.py.

00128 
00129     def hasProperty( self, id ):
00130 
00131         """ See IPropertySheet.
00132         """
00133         return id in self.propertyIds()

Here is the call graph for this function:

Here is the caller graph for this function:

See IPropertySheet.

Definition at line 170 of file UserPropertySheet.py.

00170 
00171     def propertyIds( self ):
00172 
00173         """ See IPropertySheet.
00174         """
00175         return [ x[0] for x in self._schema ]

Here is the caller graph for this function:

See IPropertySheet.

Definition at line 148 of file UserPropertySheet.py.

00148 
00149     def propertyInfo( self, id ):
00150 
00151         """ See IPropertySheet.
00152         """
00153         for schema_id, ptype in self._schema:
00154 
00155             if schema_id == id:
00156                 return { 'id' : id, 'type' : ptype, 'mode' : '' }
00157 
00158         return None

See IPropertySheet.

Definition at line 182 of file UserPropertySheet.py.

00182 
00183     def propertyItems( self ):
00184         """ See IPropertySheet.
00185         """
00186         return [ ( x, self._properties.get( x ) ) for x in self.propertyIds() ]
00187 
00188 classImplements( UserPropertySheet
00189                , IPropertySheet
00190                )

Here is the call graph for this function:

Here is the caller graph for this function:

See IPropertySheet.

Definition at line 159 of file UserPropertySheet.py.

00159 
00160     def propertyMap( self ):
00161 
00162         """ See IPropertySheet.
00163         """
00164         result = []
00165 
00166         for id, ptype in self._schema:
00167             result.append( { 'id' : id, 'type' : ptype, 'mode' : '' } )
00168 
00169         return tuple( result )

See IPropertySheet.

Definition at line 176 of file UserPropertySheet.py.

00176 
00177     def propertyValues( self ):
00178 
00179         """ See IPropertySheet.
00180         """
00181         return [ self._properties.get( x ) for x in self.propertyIds() ]

Here is the call graph for this function:


Member Data Documentation

Definition at line 101 of file UserPropertySheet.py.

Definition at line 107 of file UserPropertySheet.py.

Definition at line 106 of file UserPropertySheet.py.


The documentation for this class was generated from the following file: