I need to do initialize some properties of new instances of a DataSkin
subclass - ASPAccount.  However, I can't put this in __init__ since the
object hasn't been stored at that point.  

Doing self.__dict__['name'] = 'Rincewind' seems kinda ugly.  Maybe newItem
should by default call a function on newly created objects, say __init?  I
don't want to have to subclass Specialist (or in my case, LoginManager) each
time I want to this, since it's a *very* common action.  For example,


*** Specialists.py.orig Wed Jul 19 12:37:32 2000
--- Specialists.py      Wed Jul 19 12:38:18 2000
***************
*** 37,43 ****
      def newItem(self, key=None):
          """Create a new item"""
          # Default use first rack
!         return self.rackList[0].__of__(self).newItem(key)
  
      def manage_refreshPlugIns(self, REQUEST=None):
          """Update plugin registries"""
--- 37,46 ----
      def newItem(self, key=None):
          """Create a new item"""
          # Default use first rack
!         obj =  self.rackList[0].__of__(self).newItem(key)
!         if hasattr(obj, '__init'):
!             obj.__init()
!         return obj
  
      def manage_refreshPlugIns(self, REQUEST=None):
          """Update plugin registries"""

_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to