Package flumotion :: Package admin :: Package assistant :: Module models :: Class Properties
[hide private]

type Properties

source code

object --+    
         |    
      dict --+
             |
            Properties

I am a special dictionary which you also can treat as an instance. Setting and getting an attribute works. This is suitable for using in a kiwi proxy. >>> p = Properties() >>> p.attr = 'value' >>> p <Properties {'attr': 'value'}>

Note that you cannot insert the attributes which has the same name as dictionary methods, such as 'keys', 'values', 'items', 'update'.

Underscores are converted to dashes when setting attributes, eg:

>>> p.this_is_outrageous = True
>>> p
<Properties {'this-is-outrageous': True}>
Instance Methods [hide private]
 
__setitem__(self, attr, value)
x[i]=y
source code
 
__setattr__(self, attr, value) source code
 
__getattr__(self, attr) source code
 
__delattr__(self, attr) source code
True if D has a key k, else False
__contains__(self, value) source code
 
__repr__(self)
repr(x)
source code

Inherited from dict: __cmp__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __init__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values, viewitems, viewkeys, viewvalues

Class Variables [hide private]

Inherited from dict: __hash__

Method Details [hide private]

__setitem__(self, attr, value)
(Index assignment operator)

source code 

x[i]=y

Overrides: dict.__setitem__
(inherited documentation)

__setattr__(self, attr, value)

source code 
Overrides: object.__setattr__
(inherited documentation)

__delattr__(self, attr)

source code 
Overrides: object.__delattr__
(inherited documentation)

__contains__(self, value)
(In operator)

source code 
Returns: True if D has a key k, else False
Overrides: dict.__contains__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: dict.__repr__
(inherited documentation)