Commit 1fe3e1b8 authored by Jim Fulton's avatar Jim Fulton

Added class id (when using ZODB3).

parent 9e48c5f0
......@@ -94,7 +94,8 @@ class ZClassBasicSheet(OFS.PropertySheets.PropertySheet,
"""
manage=Globals.HTMLFile('itemProp', globals())
def manage_edit(self, meta_type='', icon='', file='', REQUEST=None):
def manage_edit(self, meta_type='', icon='', file='',
class_id=None, REQUEST=None):
"""Set basic item properties.
"""
if meta_type: self.setClassAttr('meta_type', meta_type)
......@@ -114,6 +115,9 @@ class ZClassBasicSheet(OFS.PropertySheets.PropertySheet,
self.setClassAttr('icon', icon)
if class_id is not None and class_id != self.class_id():
self.changeClassId(class_id)
if REQUEST is not None:
return self.manage(
self, REQUEST,
......@@ -124,6 +128,11 @@ class ZClassBasicSheet(OFS.PropertySheets.PropertySheet,
def classIcon(self): return self.getClassAttr('icon','')
def show_class_id(self): return Globals.DatabaseVersion=='3'
def class_id(self):
return (self.getClassAttr('__module__','') or '')[1:]
class ZClassViewsSheet(OFS.PropertySheets.PropertySheet,
OFS.PropertySheets.View):
......
......@@ -24,6 +24,15 @@ will need to be adjusted if the class is moved.</p>
value="<!--#var classMetaType-->">
</TD>
</TR>
<!--#if show_class_id-->
<TR>
<TH ALIGN="LEFT" VALIGN="TOP">class id</TH>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="TEXT" NAME="class_id" SIZE="40"
value="<!--#var class_id-->">
</TD>
</TR>
<!--#/if-->
<TR>
<TH ALIGN="LEFT" VALIGN="TOP"><EM>icon</EM></TH>
<TD ALIGN="LEFT" VALIGN="TOP">
......
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