Skip to main content

A plonehrm extension module to add notes to an employee.

Project description

Notes for Plone HRM

This extension module adds very simple notes to the Employee content type of Plone HRM.

Overview

A plonehrm extension module to add note to an employee.

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

A Note is persistent dict with a simple unicode string and a date.

>>> 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 is a persistent list that stores the notes.

>>> nts = Notes()

But it only takes text as input, not an already existing note:

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

We can still add the plain text of a Note though.

>>> 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 ...>]

And always insure that the text attribute is unicode.

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

Now we want to remove a note.

>>> 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

History of plonehrm.notes

1.0 (2008-10-02)

  • Nothing changed yet.

1.0 beta 2 (2 September 2008)

  • No history recorded.

1.0 beta 1 (13 December 2007)

  • Initial beta release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for plonehrm.notes, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size plonehrm.notes-1.0.tar.gz (14.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page