本文整理汇总了Python中OFS.Folder.Folder.title方法的典型用法代码示例。如果您正苦于以下问题:Python Folder.title方法的具体用法?Python Folder.title怎么用?Python Folder.title使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OFS.Folder.Folder
的用法示例。
在下文中一共展示了Folder.title方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_store_properties
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import title [as 别名]
def test_store_properties(self):
conn = self.db.open()
try:
app = conn.root()['Application']
f = Folder()
f.id = 'Holidays'
f.title = 'Holiday Calendar'
app._setObject(f.id, f, set_owner=0)
transaction.commit()
f._setProperty('pi', 3.14, 'float')
f._setProperty('stuff', ['a', 'bc', 'd'], 'lines')
transaction.commit()
conn2 = self.db.open()
try:
app = conn2.root()['Application']
self.assert_(hasattr(app, 'Holidays'))
got = 0
for k, v in app.Holidays.propertyItems():
if k == 'title':
got += 1
self.assertEqual(v, 'Holiday Calendar')
elif k == 'pi':
got += 1
self.assertEqual(v, 3.14)
elif k == 'stuff':
got += 1
self.assertEqual(tuple(v), ('a', 'bc', 'd'))
self.assertEqual(got, 3)
finally:
conn2.close()
finally:
conn.close()
示例2: _makeSite
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import title [as 别名]
def _makeSite( self, title="Don't care" ):
site = Folder()
site._setId( 'site' )
site.title = title
self.app._setObject( 'site', site )
return self.app._getOb( 'site' )
示例3: manage_addFolder
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import title [as 别名]
def manage_addFolder(dispatcher, id,
itemClass,
sessionName='',
title='',
REQUEST=None):
"""Adds a new Folder object with id *id*.
"""
id = str(id)
ob = Folder(id)
ob.title = str(title)
ob.item_class = _my_import(itemClass)
ob.session_name = str(sessionName)
dispatcher._setObject(id, ob)
ob = dispatcher._getOb(id)
if REQUEST is not None:
return dispatcher.manage_main(dispatcher, REQUEST, update_menu=1)
示例4: test_store_selection_properties
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import title [as 别名]
def test_store_selection_properties(self):
conn = self.db.open()
try:
app = conn.root()['Application']
f = Folder()
f.id = 'Holidays'
f.title = 'Holiday Calendar'
app._setObject(f.id, f, set_owner=0)
transaction.commit()
f._setProperty('choices', ['alpha', 'omega', 'delta'], 'lines')
f._setProperty('greek', 'choices', 'multiple selection')
f._setProperty('hebrew', 'choices', 'selection')
f.greek = ['alpha', 'omega']
f.hebrew = 'alpha'
transaction.commit()
conn2 = self.db.open()
try:
app = conn2.root()['Application']
self.assert_(hasattr(app, 'Holidays'))
got = 0
for k, v in app.Holidays.propertyItems():
if k == 'greek':
got += 1
self.assertEqual(tuple(v), ('alpha', 'omega'))
if k == 'hebrew':
got += 1
self.assertEqual(v, 'alpha')
self.assertEqual(got, 2)
# Be sure the select_variable got restored.
dict = app.Holidays.propdict()
self.assertEqual(dict['greek']['select_variable'], 'choices')
self.assertEqual(dict['hebrew']['select_variable'], 'choices')
finally:
conn2.close()
finally:
conn.close()
示例5: refreshDB
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import title [as 别名]
def refreshDB(self):
""" All actions to take when refreshing a DB (after import for
instance).
"""
logger.info('Refreshing database ' + self.id)
report = []
self.setStatus(_("Refreshing design"))
# migrate to current version
messages = migrate(self)
for msg in messages:
report.append(msg)
logger.info(msg)
# check folders
if not hasattr(self, 'resources'):
resources = Folder('resources')
resources.title = 'resources'
self._setObject('resources', resources)
msg = 'Resources folder OK'
report.append(msg)
logger.info(msg)
if not hasattr(self, 'scripts'):
scripts = Folder('scripts')
scripts.title = 'scripts'
self._setObject('scripts', scripts)
self.cleanFormulaScripts()
msg = 'Scripts folder OK and clean'
report.append(msg)
logger.info(msg)
# clean portal_catalog
portal_catalog = self.portal_catalog
catalog_entries = portal_catalog.search({
'portal_type': ['PlominoDocument'],
'path': '/'.join(self.getPhysicalPath())
})
for d in catalog_entries:
portal_catalog.uncatalog_object(d.getPath())
msg = 'Portal catalog clean'
report.append(msg)
logger.info(msg)
# create new blank index (without fulltext)
index = PlominoIndex(FULLTEXT=False).__of__(self)
index.no_refresh = True
msg = 'New index created'
report.append(msg)
logger.info(msg)
# declare all indexed fields
for f_obj in self.getForms():
for f in f_obj.getFormFields():
if f.to_be_indexed:
index.createFieldIndex(
f.id,
f.field_type,
indextype=f.index_type,
fieldmode=f.field_mode)
logger.info('Field indexing initialized')
# declare all the view formulas and columns index entries
for v_obj in self.getViews():
index.createSelectionIndex(
'PlominoViewFormula_' + v_obj.id)
for c in v_obj.getColumns():
v_obj.declareColumn(c.id, c, index=index)
# add fulltext if needed
if self.fulltextIndex:
index.createFieldIndex('SearchableText', 'RICHTEXT')
logger.info('Views indexing initialized')
# re-index documents
start_time = DateTime().toZone(TIMEZONE)
msg = self.reindexDocuments(index)
report.append(msg)
# Re-indexed documents that have changed since indexing started
msg = self.reindexDocuments(index, changed_since=start_time)
report.append(msg)
index.no_refresh = False
# destroy the old index and rename the new one
self.manage_delObjects("plomino_index")
self._setObject('plomino_index', index.aq_base)
msg = 'Old index removed and replaced'
report.append(msg)
logger.info(msg)
# refresh portal_catalog
if self.indexInPortal:
self.refreshPortalCatalog()
# update Plone workflow state and role permissions
self.refreshWorkflowState()
self.refreshPlominoRolesPermissions()
self.setStatus(_("Ready"))
return report
示例6: __call__
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import title [as 别名]
def __call__(self, id, title):
archive = Folder(id)
archive.title = title
directlyProvides(archive, IListArchive)
return archive
示例7: __call__
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import title [as 别名]
def __call__(self, id, title, **kwargs):
folder = Folder(id)
folder.title = title
return folder