Metadata-Version: 2.4
Name: collective.schedulefield
Version: 2.0.0
Summary: Schedule behaviors for Plone content types
Author-email: iMio <support@imio.be>
License-Expression: GPL-2.0-only
Project-URL: PyPI, https://pypi.org/project/collective.schedulefield
Project-URL: Source, https://github.com/IMIO/collective.schedulefield
Project-URL: Issues, https://github.com/IMIO/collective.schedulefield/issues
Project-URL: Changelog, https://github.com/IMIO/collective.schedulefield/blob/master/CHANGES.md
Keywords: Python,Plone,CMS
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Plone
Classifier: Framework :: Plone :: 6.2
Classifier: Framework :: Plone :: Addon
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.GPL
License-File: LICENSE.md
Requires-Dist: Plone
Provides-Extra: test
Requires-Dist: Products.CMFPlacefulWorkflow; extra == "test"
Requires-Dist: plone.api; extra == "test"
Requires-Dist: plone.app.contenttypes[test]; extra == "test"
Requires-Dist: plone.app.testing; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-plone; extra == "test"
Requires-Dist: zest.releaser[recommended]; extra == "test"
Requires-Dist: zestreleaser.towncrier; extra == "test"
Dynamic: license-file

# collective.schedulefield

[![Tests](https://github.com/IMIO/collective.schedulefield/actions/workflows/test-matrix.yml/badge.svg)](https://github.com/IMIO/collective.schedulefield/actions/workflows/test-matrix.yml)
[![Meta](https://github.com/IMIO/collective.schedulefield/actions/workflows/meta.yml/badge.svg)](https://github.com/IMIO/collective.schedulefield/actions/workflows/meta.yml)

Schedule behaviors for Plone content types.

## Features

- Schedule or multi-schedule (with date ranges) behaviors to define schedules (morning / afternoon / comment) by day of week
- Exceptional closure behavior to define closing days

## Compatibility

* Versions **2.x** support **Plone 6.2**, on Python 3.10 to 3.14.
* Versions **1.x** are developed for **Plone 6.0 and 6.1**.
* Versions **0.x** are developed for **Plone 4 & Plone 5**.

  > Please note that they do not provide the full functionality (no multi-schedules,
  > no exceptional closures, no RESTAPI serializer).

## Installation

Add `collective.schedulefield` to the dependencies of your project
(`pyproject.toml`, or `requirements.txt` with the Plone constraints), install
it, restart Plone and activate the add-on in *Site Setup* > *Add-ons*. Then
enable the behaviors you need on your content types.

## Development

Requires [uv](https://docs.astral.sh/uv/). This installs Plone 6.2.3 on Python
3.14 in `.venv` (set `PLONE_VERSION` for another Plone 6.2 release) and the prek
git hook:

```shell
make install
make start          # Plone on http://localhost:8080 (admin / admin)
```

Create a Classic UI site from the browser, then activate collective.schedulefield.

### Tests

Tests run through tox, as the CI does:

```shell
make test                                   # Plone 6.2.3
uvx --with tox-uv tox -e py310-plone62      # one Python version
make test-all                               # lint, every Python version, dependencies
```

Without tox:

```shell
.venv/bin/pytest tests
```

### Lint

```shell
make check          # format then lint (pyupgrade, isort, black, zpretty, flake8...)
```

### Translations

```shell
make i18n           # rebuild the collective.schedulefield catalogs
```

`.editorconfig`, `.flake8`, `.gitignore`, `.pre-commit-config.yaml`, `tox.ini`,
`.github/` and the tool sections of `pyproject.toml` are generated by
[plone.meta](https://github.com/plone/meta): change `.meta.toml`, then run
`uvx --from plone.meta==2.12.0 config-package --no-commit --branch current .`.

## Contribute

Have an idea? Found a bug? Let us know by [opening a ticket](https://github.com/IMIO/collective.schedulefield/issues).

* **Issue Tracker**: [https://github.com/IMIO/collective.schedulefield/issues](https://github.com/IMIO/collective.schedulefield/issues)
* **Source Code**: [https://github.com/IMIO/collective.schedulefield](https://github.com/IMIO/collective.schedulefield)

## License

The project is licensed under the **GPLv2**.

# Contributors

- Gillian Sampont, Original Author [Affinitic]
- Benoît Suttor [iMio]
- Christophe Boulanger [iMio]
- François Bruynbroeck [Affinitic]
- Laurent Lasudry [Affinitic]
- Martin Peeters [Affinitic]
- Rémi Dubois [iMio]
- Stéphan Geulette [iMio]

# Changelog

<!-- towncrier release notes start -->

## 2.0.0 (2026-11-24)


- Breaking: replace the `pkg_resources` namespace of `collective` with a PEP 420
  native namespace. Support Plone 6.2 only, on Python 3.10 to 3.14. Use 1.1
  for Plone 6.0 and 6.1.
  [remdub]

- Configure the package with plone.meta 2.12.0 (test matrix on Plone 6.2.3),
  move its metadata to `pyproject.toml`, convert the license to Markdown and
  run the development environment on Plone 6.2.3 with uv instead of buildout.
  Declare `plone.api` in the `test` extra and drop the `dev` extra.
  [remdub]


## 1.1 (2025-05-08)

- Update locales https://github.com/IMIO/collective.schedulefield/issues/3
  [remdub]

- Add test environment using pytest, with test coverage reaching 80% https://github.com/IMIO/collective.schedulefield/issues/2
  [remdub]

- Fix MultiSchedule viewlet https://github.com/IMIO/collective.schedulefield/issues/4
  [remdub]

- Upgrade dev environment to Plone 6.1-latest
  [remdub]


## 1.0a3 (2023-01-12)

- MANIFEST / release fix
  [laulaz]


## 1.0a2 (2023-01-12)

- Drop support for Plone 4 & Plone 5
  [laulaz]

- Fix AttributeError traceback when accessing subforms
  [laulaz]


## 1.0a1 (2022-12-13)

- Add basic serializers / deserializers
  [laulaz]

- Display schedule viewlets only on views (not on folder_contents, cropping, etc.)
  [laulaz]

- Fix error when validating an empty value for a schedule
  [laulaz]

- Add missing key_type/value_type for Schedule field. This is needed (at least)
  to export types schemas information
  [laulaz]

- Fix python3 compatibility : Use @implementer instead of implements
  [boulch]

- Handle multi schedules and exceptional closures
  [fbruynbroeck]


## 0.6.1 (2018-10-15)

- Do not display comment if empty.
  [bsuttor]


## 0.6 (2018-04-23)

- Also view schedule if only comment is set.
  [bsuttor]

- Added missing z3c.form meta.zcml.
  [sgeulette]


## 0.5 (2017-04-27)

- Bugfix: get json schedule.
  [bsuttor]


## 0.4 (2017-04-25)

- Bugfix: do not try to load json value if there is no values.
  [bsuttor]


## 0.3 (2017-03-01)

- Do not render the viewlet if there is no values
  [mpeeters]


## 0.2 (2016-07-14)

- Add the ScheduledContent behavior
  [mpeeters]

- Add a comment field for each schedule day
  [mpeeters]


## 0.1 (2014-08-26)

 - Initial release
