Package orm2 :: Package ui :: Class view_spec
[hide private]
[frames] | no frames]

Class view_spec

source code

The view spec class provides a mechanism to lazily load views at runtime. This avoids infinite loops in complex module hierarchies that have seperate modules for dbclasses and views. Defining you dbclass like this:
  class font(dbobject):
      id = serial()
      ps_name = text()
      user_name = Unicode()

      preview = view_spec('myproject.views.font')
will cause the myproject.views.font module to be loaded. It must contain a class names preview which inherits from orm2.ui.view. This class will be instantiated and put into the font dbobject on initialization.

Instance Methods [hide private]
  __init__(self, module_name)
  import_(self, class_name)

Method Details [hide private]

__init__(self, module_name)
(Constructor)

source code 
None

import_(self, class_name)

source code 
None