Logo Search packages:      
Sourcecode: zeitgeist version File versions

def _zeitgeist::engine::base::Entity::__init__ (   self,
  value,
  add_to_store = True 
)

Create an Entity in the store. Any created entity will automatically
   be added to the store (but the store still need flushing) before an
   id is assigned to the entity

Definition at line 66 of file base.py.

00066                                                    :
            """Create an Entity in the store. Any created entity will automatically
               be added to the store (but the store still need flushing) before an
               id is assigned to the entity"""
            if self.__class__ == Entity:
                  raise ValueError("Entity is an abstract class an "
                                           "can not be instantiated")
            if value is None :
                  raise ValueError("Can not create Entity with value None")
            
            self.value = unicode(value) # A no-op if value is already a unicode
            
            if add_to_store:
                  _store.add(self)
                  _store.flush()
                  self.__class__.CACHE[value] = self
      
      def resolve (self):


Generated by  Doxygen 1.6.0   Back to index