Back to index

plone3  3.1.7
Classes | Functions | Variables
Archetypes.athistoryaware Namespace Reference

Classes

class  ATHistoryAwareMixin

Functions

def _historicalRevision
def _objectRevisions

Variables

string __author__ = 'Martijn Pieters <mj@zopatista.com>'
 Copyright (c) 2002-2005, Benjamin Saller bcsal.nosp@m.ler@.nosp@m.ideas.nosp@m.uite.nosp@m..com, and the respective authors.

Function Documentation

def Archetypes.athistoryaware._historicalRevision (   self,
  tid 
) [private]

Definition at line 86 of file athistoryaware.py.

00086 
00087 def _historicalRevision(self, tid):
00088     state = self._p_jar.oldstate(self, tid)
00089     try:
00090         rev = self.__class__.__basicnew__()
00091     except AttributeError:
00092         rev = self.__class__()
00093     rev._p_jar = HystoryJar(self._p_jar)
00094     rev._p_oid = self._p_oid
00095     rev._p_serial = tid
00096     rev.__setstate__(state)
00097     rev._p_changed = 0
00098     return rev

Here is the caller graph for this function:

def Archetypes.athistoryaware._objectRevisions (   obj,
  limit = 10 
) [private]
Iterate over (thread id, persistent object revisions), up to limit

Definition at line 99 of file athistoryaware.py.

00099 
00100 def _objectRevisions(obj, limit=10):
00101     """Iterate over (thread id, persistent object revisions), up to limit"""
00102     for rev in obj._p_jar.db().history(obj._p_oid, None, limit):
00103         tid = rev.get('tid', None) or rev.get('serial', None)
00104         if not tid: # Apparently not all storages provide this?
00105             return
00106         # Set 'tid' so we don't have to test for 'serial' again
00107         rev['tid'] = tid
00108         rev['object'] = _historicalRevision(obj, tid)
00109         yield tid, rev

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

string Archetypes.athistoryaware.__author__ = 'Martijn Pieters <mj@zopatista.com>'

Copyright (c) 2002-2005, Benjamin Saller bcsal.nosp@m.ler@.nosp@m.ideas.nosp@m.uite.nosp@m..com, and the respective authors.

All rights reserved. For a list of Archetypes contributors see docs/CREDITS.txt.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    • Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.

Definition at line 26 of file athistoryaware.py.