Skip to content

Commit

Permalink
move show_id.py from CMFPlone to Archetypes
Browse files Browse the repository at this point in the history
  • Loading branch information
davisagli committed Nov 13, 2016
1 parent a05a65e commit 0730de3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ New features:
Make AnnotationStorage awareness of it optional.
[jensens]

- moved script ``date_components_support.py`` from CMFPlone over here,
hence its only used here.
[jensens]
- Moved scripts that are only used by Archetypes from CMFPlone
to Products.Archetypes:
- ``date_components_support.py``
- ``show_id.py``
[jensens, davisagli]

Bug fixes:

Expand Down
14 changes: 14 additions & 0 deletions Products/Archetypes/skins/archetypes/show_id.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Script (Python) "show_id"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=Determine whether to show an id in an edit form

if context.plone_utils.isIDAutoGenerated(context.REQUEST.get('id', None) \
or context.getId()):
return not (context.portal_factory.isTemporary(context)
or context.CreationDate() == context.ModificationDate())
return 1

0 comments on commit 0730de3

Please sign in to comment.