跳转到主要内容

为员工添加注释的plonehrm扩展模块。

项目描述

Plone HRM的注释

此扩展模块为Plone HRM的员工内容类型添加了非常简单的备注。

概述

一个plonehrm扩展模块,用于添加员工备注。

>>> from plonehrm.notes.notes import Note, Notes

备注是一个持久的字典,包含简单的Unicode字符串和日期。

>>> n1 = Note(u'My first little note.')
>>> n1.text
u'My first little note.'
>>> from datetime import date
>>> n1.date == date.today().isoformat()
True

Notes是一个持久的列表,用于存储备注。

>>> nts = Notes()

但它只接受文本输入,不接受已存在的备注

>>> nts.addNote(n1)
Traceback (most recent call last):
AssertionError: string expected, got <class 'plonehrm.notes.notes.Note'>

尽管如此,我们仍然可以添加备注的纯文本。

>>> nts.addNote(n1.text)
>>> nts.addNote(u'It could be much longer if you prefer that.')
>>> print nts
[<plonehrm.notes.notes.Note ...>, <plonehrm.notes.notes.Note ...>]

并且始终确保文本属性是Unicode。

>>> n3 = Note(u'H\xc3\xa9 daar!')
>>> unicode(n3.text)
u'H\xc3\xa9 daar!'
>>> n3.text
u'H\xc3\xa9 daar!'

现在我们想删除一个备注。

>>> nts.addNote(u"Please remove this note.")
>>> len(nts)
3
>>> nts.removeNote(u"Please remove this note.")
>>> len(nts)
2
>>> nts.removeNote(u"This note does not exist.")
Traceback (most recent call last):
...
ValueError: list.remove(x): x not in list

plonehrm.notes的历史

1.1 (2010-01-15)

  • 在测试中进行了某些更改,以便它可以处理新的权限检查。[vincent]

1.0.7 (2010-01-07)

  • 视图小部件现在受“plonehrm: view notes viewlet”权限保护。“删除”按钮受“plonehrm: manage notes”保护,而“添加”按钮仍然受“plonehrm: add note”保护。[vincent]

1.0.6 (2009-07-29)

  • 更新了备注视图小部件的KSS动作。现在,在创建或删除备注时显示信息消息。当用户点击“取消”按钮时,消息将被隐藏。[vincent]

1.0.5 (2009-06-23)

  • 尚未更改。

1.0.4 (2009-06-15)

  • 尚未更改。

1.0.3 (2009-06-03)

  • 现在,“备注”视图小部件在员工视图中充当其他视图小部件。标题中有一个“添加”按钮,允许显示一个表单以添加新的备注。一旦添加了备注,表单就会消失,列表再次显示。[vincent]

1.0.2 (2009-05-26)

  • 在备注视图小部件中添加了notes_listing链接。[jladage]

  • 从本地移除了.mo文件。这意味着这些翻译在旧Plone 3.0中将不可见。[maurits]

1.0.1 (2009-04-16)

  • 从rolemap.xml中移除了plonehrm: Add/Modify personaldata权限。这些权限很快就会消失,我不确定它们最初在这里的plonehrm.notes中做了什么…[maurits+mike]

  • 使用collective.autopermission注册权限。[maurits]

  • 将换行符风格设置为本地,并设置svn:ignore。[maurits]

1.0 (2008-10-02)

  • 没有记录历史。

1.0 beta 2 (2008年9月2日)

  • 没有记录历史。

1.0 beta 1 (2007年12月13日)

  • 初始beta版本。

项目详情


下载文件

下载您平台上的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

plonehrm.notes-1.1.tar.gz (17.2 kB 查看散列)

上传时间

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面