Package dap :: Package responses :: Package html :: Module templess :: Class objectcontext
[hide private]
[frames] | no frames]

Class objectcontext

source code

object --+
         |
        objectcontext

wrapper around objects to allow Templess to traverse attributes

this is similar to the nastyness Zope exposes to its users in TAL,
when Templess retrieves a key from the context, if the context is
an objectcontext wrapping an object, instead of just doing a 
__getitem__ the following will be done:

- first a __getitem__ is tried, then a __getattr_, if the value is
  still not found a KeyError is raised

- before the value is returned, a check is done whether it's callable,
  and if so it's called (without arguments)



Instance Methods [hide private]
  __init__(self, o)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __getitem__(self, name)
  __str__(self)
str(x)
  __repr__(self)
repr(x)
  __getattr__(self, name)
  wrap(self, obj)
  __hasattr__(self, name)

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__


Class Variables [hide private]
  __marker__ = []

Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, o)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

__getitem__(self, name)
(Indexing operator)

source code 
None

__str__(self)
(Informal representation operator)

source code 
str(x)
Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: object.__repr__
(inherited documentation)

__getattr__(self, name)
(Qualification operator)

source code 
None

wrap(self, obj)

source code 
None

__hasattr__(self, name)

source code 
None

Class Variable Details [hide private]

__marker__

None
Value:
[]