appy.gen: added the possibility to create and manage web pages into an app; every class can now define a method showPortlet. If the class does not define it or if it returns False, the portlet won't be shown when showing/editing instances of this class.
This commit is contained in:
parent
8aa03a091a
commit
1e9e4df5a6
9 changed files with 113 additions and 28 deletions
10
gen/utils.py
10
gen/utils.py
|
@ -18,8 +18,14 @@ def createObject(folder, id, className, appName, wf=True):
|
|||
obj.portal_type = className
|
||||
obj.id = id
|
||||
obj._at_uid = id
|
||||
userId = obj.getUser().getId()
|
||||
# If user is anonymous, userIs is None
|
||||
user = obj.getUser()
|
||||
if not user.getId():
|
||||
if user.name == 'System Processes':
|
||||
userId = 'admin' # This is what happens when Zope is starting.
|
||||
else:
|
||||
userId = None # Anonymous.
|
||||
else:
|
||||
userId = user.getId()
|
||||
obj.creator = userId or 'Anonymous User'
|
||||
from DateTime import DateTime
|
||||
obj.created = DateTime()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue