Skip to main content

A datatype which stores a year and a month.

Project description

Copyright (c) 2009-2015 gocept gmbh & co. kg All Rights Reserved.

All Rights Reserved.

This software is subject to the provisions of the Zope Public License, Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. THIS SOFTWARE IS PROVIDED “AS IS” AND ANY AND ALL EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.

gocept.month

A datatype which stores a year and a month.

https://builds.gocept.com/job/gocept.month/badge/icon

This package provides the data type Month (typical usage: Month(4, 2003)), which supports conversion to and from strings, as well as a zope.schema field and widgets for both zope.formlib and z3c.form.

To use the month field, <include package="gocept.month"/> and declare a schema like this:

>>> import gocept.month
>>> import zope.interface
>>> import zope.schema
>>> class IContract(zope.interface.Interface):
...     title = zope.schema.TextLine(title=u"Contract title")
...     start = gocept.month.MonthField(title=u"Starting date")
...     end = gocept.month.MonthField(title=u"Ending date")

To use the form widgets, you need to require the form setuptools extra (i.e. gocept.month[form]), and <include package="gocept.month.browser"/> in your ZCML.

CHANGES

1.3.1 (2015-08-05)

1.3 (2014-07-16)

  • Add placeholder for month widget in z3c forms describing the required month format.

1.2 (2013-02-18)

  • Split off widgets into setuptools extra form, and don’t include the browser ZCML by ourselves, so clients can use only the domain part of this package without the UI parts.

  • Added firstOfMonth method to Month.

  • Using zope.formlib >= 4.0 instead of zope.app.form.

  • Updated to ZTK 1.1.5.

1.1 (2012-02-09)

  • Add MonthInterval.forYear().

  • Declared fromString method as a class method in interface.

1.0.2 (2011-09-01)

  • Added __contains__ method on Month.

1.0.1 (2011-04-26)

  • Declare dependencies that some upstream packages need but don’t declare.

  • Use stdlib’s doctest module, not zope.testing’s which is deprecated.

1.0 (2009-10-05)

  • Initial public release.

Project details


Download files

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

Source Distribution

gocept.month-1.3.1.tar.gz (15.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page