Commit 229b5573 authored by Jim Fulton's avatar Jim Fulton

Added two new methods, bobobase_modification_time, and

modified_in_session, to support flagging new and session objects.
parent 4932d77f
__doc__="""Object Manager __doc__="""Object Manager
$Id: ObjectManager.py,v 1.16 1997/11/06 15:41:48 jim Exp $""" $Id: ObjectManager.py,v 1.17 1997/11/10 14:54:42 jim Exp $"""
__version__='$Revision: 1.16 $'[11:-2] __version__='$Revision: 1.17 $'[11:-2]
from SingleThreadedTransaction import Persistent from SingleThreadedTransaction import Persistent
...@@ -15,6 +15,7 @@ from string import find,join,lower ...@@ -15,6 +15,7 @@ from string import find,join,lower
from urllib import quote from urllib import quote
from DocumentTemplate import html_quote from DocumentTemplate import html_quote
from cgi_module_publisher import type_converters from cgi_module_publisher import type_converters
from DateTime import DateTime
class ObjectManager(Acquirer,Management,Persistent): class ObjectManager(Acquirer,Management,Persistent):
"""Generic object manager """Generic object manager
...@@ -396,9 +397,31 @@ class ObjectManager(Acquirer,Management,Persistent): ...@@ -396,9 +397,31 @@ class ObjectManager(Acquirer,Management,Persistent):
r.append({'id': n, 'input': imap[t](None,n,t,v)}) r.append({'id': n, 'input': imap[t](None,n,t,v)})
return r return r
def bobobase_modification_time(self):
try:
t=self._p_mtime
if t is None: return DateTime()
except: t=0
return DateTime(t)
def modified_in_session(self):
jar=self._p_jar
if jar is None: return 1
if not jar.name: return 0
try: jar.db[self._p_oid]
except: return 0
return 1
############################################################################## ##############################################################################
# #
# $Log: ObjectManager.py,v $ # $Log: ObjectManager.py,v $
# Revision 1.17 1997/11/10 14:54:42 jim
# Added two new methods, bobobase_modification_time, and
# modified_in_session, to support flagging new and session objects.
#
# Revision 1.16 1997/11/06 15:41:48 jim # Revision 1.16 1997/11/06 15:41:48 jim
# Got rid of PARENT_URL in deleteProperties error dialog. # Got rid of PARENT_URL in deleteProperties error dialog.
# #
......
...@@ -16,10 +16,11 @@ Aqueduct database adapters, etc. ...@@ -16,10 +16,11 @@ Aqueduct database adapters, etc.
This module can also be used as a simple template for implementing new This module can also be used as a simple template for implementing new
item types. item types.
$Id: SimpleItem.py,v 1.3 1997/11/06 18:41:56 jim Exp $''' $Id: SimpleItem.py,v 1.4 1997/11/10 14:55:14 jim Exp $'''
__version__='$Revision: 1.3 $'[11:-2] __version__='$Revision: 1.4 $'[11:-2]
import Globals import Globals
from DateTime import DateTime
class Item: class Item:
...@@ -66,6 +67,20 @@ class Item: ...@@ -66,6 +67,20 @@ class Item:
def manage_editedDialog(self, REQUEST, **args): def manage_editedDialog(self, REQUEST, **args):
return apply(self._manage_editedDialog,(self, REQUEST), args) return apply(self._manage_editedDialog,(self, REQUEST), args)
def bobobase_modification_time(self):
try:
t=self._p_mtime
if t is None: return DateTime()
except: t=0
return DateTime(t)
def modified_in_session(self):
jar=self._p_jar
if jar is None: return 1
if not jar.name: return 0
try: jar.db[self._p_oid]
except: return 0
return 1
class Item_w__name__(Item): class Item_w__name__(Item):
...@@ -85,6 +100,10 @@ class Item_w__name__(Item): ...@@ -85,6 +100,10 @@ class Item_w__name__(Item):
############################################################################## ##############################################################################
# #
# $Log: SimpleItem.py,v $ # $Log: SimpleItem.py,v $
# Revision 1.4 1997/11/10 14:55:14 jim
# Added two new methods, bobobase_modification_time, and
# modified_in_session, to support flagging new and session objects.
#
# Revision 1.3 1997/11/06 18:41:56 jim # Revision 1.3 1997/11/06 18:41:56 jim
# Added manage_editedDialog. # Added manage_editedDialog.
# #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment