Beispiel #1
0
 def __setstate__(self, state):
     # Makes sure we have an Entry class now
     self._refreshEntryClass()
     Persistent.__setstate__(self, state)
     self._v_conn = None
     self._v_delete = []
     self._v_openc = 0
Beispiel #2
0
 def __setstate__(self, state):
     Persistent.__setstate__(self, state)
     if self.connection_string:
         try: self.connect(self.connection_string)
         except:
             LOG.error('Error connecting to relational database.',
                       exc_info=True)
Beispiel #3
0
    def __setstate__(self, state):
        """Upgrade annotation instances"""
        Persistent.__setstate__(self, state)

        # Put in encoding if it's missing
        if not hasattr(self, 'encoding'):
            self.encoding = ''

        # Change string dates to DateTime dates
        for property in self.propertyMap():
            id = property['id']
            if id not in ['date', 'created']: continue # Skip non-date properties
            if property['type'] == 'string':
                value = self.getProperty(id)
                self.manage_delProperties([id])
                try:
                    self.manage_addProperty(id, value, 'date')
                except:
                    self.manage_addProperty(id, '1970/01/01', 'date')

        # Ensure that date and created are valid DateTime 
        try:
            self.date = DateTime(self.date)
            self.created = DateTime(self.created)
        except:
            pass
 def __setstate__(self, state):
     Persistent.__setstate__(self, state)
     if self.connect_on_load and self.connection_string:
         try: self.connect(self.connection_string)
         except:
             LOG.error('Error connecting to relational database.',
                       exc_info=True)
 def __init__(self, context):
     Persistent.__init__(self)
     if self._mark:
         _mark_asynch(context)
         transaction.commit()
     portal_state = getMultiAdapter((context, context.REQUEST), name=u'plone_portal_state')
     self.userid = portal_state.member().getId()
     self.uid = context.UID()
Beispiel #6
0
	def __setstate__(self, state):
		Persistent.__setstate__(self, state)
		if not hasattr(self, 'currentGroupSource'):
			self.currentGroupSource = None
		if not hasattr(self, 'sessionLength'):
			self.sessionLength = 0
		if not hasattr(self, 'notSessionLength'):
			self.notSessionLength = 0
		if not hasattr(self, 'cookie_mode'):
			self.cookie_mode = 0
		if not hasattr(self, 'sessionTraining'):
			self.sessionTracking = None
		if not hasattr(self, 'idleTimeout'):
			self.idleTimeout=0
 def __setstate__(self, state):
     """ initialize your brains.  This method is called when the
     catalog is first activated (from the persistent storage) """
     Persistent.__setstate__(self, state)
     self.updateBrains()
Beispiel #8
0
 def __new__(cls, x, y):
     r = Persistent.__new__(cls)
     r.x, r.y = x, y
     return r
Beispiel #9
0
 def __setstate__(self, state):
     """ initialize your brains.  This method is called when the
     catalog is first activated (from the persistent storage) """
     Persistent.__setstate__(self, state)
     self.updateBrains()
Beispiel #10
0
 def __setstate__(self, state):
     # Makes sure we have an Entry class now
     self._refreshEntryClass()
     Persistent.__setstate__(self, state)
Beispiel #11
0
 def __setstate__(self, state):
     # Makes sure we have an Entry class now
     self._refreshEntryClass()
     Persistent.__setstate__(self, state)
Beispiel #12
0
 def __setstate__(self, state):
     Persistent.__setstate__(self, state)
     self.addSQLQueries()
Beispiel #13
0
 def __setstate__(self, state):
     """ Skip super's __setstate__ as it connects which we don't want
         due to pool_key depending on acquisition.
     """
     Persistent.__setstate__(self, state)