.. image:: https://travis-ci.org/collective/collective.behavior.talcondition.svg?branch=master
:target: https://travis-ci.org/collective/collective.behavior.talcondition
.. image:: https://coveralls.io/repos/collective/collective.behavior.talcondition/badge.png
:target: https://coveralls.io/r/collective/collective.behavior.talcondition
==========================================================================
collective.behavior.talcondition
==========================================================================
This package works for dexterity (behavior) and archetypes (schema extender).
It adds two fields on a content type or class:
* tal_condition : enter a `TAL expression <http://docs.zope.org/zope2/zope2book/AppendixC.html>`_ that once evaluated will return 'True' if content should be available. By default, elements 'member', 'context' and 'portal' are available for the expression but the TAL expression context may be extended using the 'extra_expr_ctx' parameter.
* roles_bypassing_talcondition : choose the different roles for which the TAL condition will not be evaluated and always considered \'True\'
It's then possible to use the 'evaluate' method to test the TAL condition.
How to use it
=============
For AT you have to provide the ITALConditionable on your class (see testing.zcml).
For DX you just have to activate the behavior on your content type.
Plone versions
==============
It has been developed and tested for Plone 4 and 5.
Translations
============
This product has been translated into
- French.
- Spanish.
You can contribute for any message missing or other new languages, join us at `Plone Collective Team <https://www.transifex.com/plone/plone-collective/>`_ into *Transifex.net* service with all world Plone translators community.
Changelog
=========
1.0.0 (2024-09-18)
------------------
- Generated universal wheel version.
[sgeulette]
1.0a2 (2024-09-16)
------------------
- Fix dict iteration for Python 3
[laulaz]
- Updated Makefile
[sgeulette]
- Used pyenv in gha
[sgeulette]
1.0a1 (2023-06-21)
------------------
- Fix deprecated import AccessControl.class_init instead of App.class_init
(Plone6 compatibility)
[boulch]
- Set simplier setup with Makefile
[sgeulette]
0.14 (2021-06-29)
-----------------
- Fix pypi broken package
[boulch]
0.13 (2021-06-29)
-----------------
- Add uninstall profile
[boulch]
- Add Plone6 compatibily
[boulch]
0.12 (2021-04-20)
-----------------
- Add Transifex.net service integration to manage the translation process.
[macagua]
- Add Spanish translation
[macagua]
- Do not consider the `archetypes.schemaextender` on Plone5.
[gbastien]
- Adapted code (except, implementer) to be Python3 compatible.
[gbastien]
- Added parameter `trusted=False` to `utils._evaluateExpression`, this will use
a trusted expression handler instead the restricted python default.
[gbastien]
0.11 (2019-05-16)
-----------------
- Added parameter `raise_on_error` to `utils.evaluateExpressionFor` to raise an
error when an exception occurs instead returning False.
[gbastien]
- Added method `TALCondition.complete_extra_expr_ctx` to the behavior to
formalize the way to get `extra_expr_ctx` to avoid the `evaluate` method
to be overrided.
[gbastien]
0.10 (2018-11-20)
-----------------
- Do not break if parameter `expression` passed to
`utils._evaluateExpression` is None.
[gbastien]
0.9 (2018-10-12)
----------------
- Added new parameter `error_pattern=WRONG_TAL_CONDITION` to
`utils.evaluateExpressionFor` and underlying `utils._evaluateExpression` to
be able to log a custom message in case an error occurs during
expression evaluation.
[gbastien]
0.8 (2018-06-12)
----------------
- Mark elements using behavior with `ITALConditionable` interface so it behaves
like element using the AT extender.
[gbastien]
0.7 (2017-03-22)
----------------
- Use CheckBoxWidget for `ITALCondition.roles_bypassing_talcondition` to ease
selection when displaying several elements.
[gbastien]
0.6 (2016-01-12)
----------------
- Added parameter `empty_expr_is_true` to utils._evaluateExpression than may be True
or False depending that we want an empty expression to be considered True or False.
Previous behavior is kept in utils.evaluateExpressionFor where an empty expression
is considered True. This avoid managing an empty expression in the caller method
[gbastien]
0.5 (2015-12-17)
----------------
- Added method utils._evaluateExpression that receives an expression
to evaluate, it is called by utils.evaluateExpressionFor. This way, this
method may evaluate a TAL expression without getting it from the `tal_condition`
attribute on the context, in case we want to evaluate arbitrary expression
[gbastien]
0.4 (2015-09-16)
----------------
- Make the tal_condition field larger (from 30 to 80) for the
AT extender as well as for the DX behavior
[gbastien]
- Added possibility to extend TAL expression context by passing
an `extra_expr_ctx` dict to utils.evaluateExpressionFor, also
integrated to the `evaluate` method of the DX behavior
[gbastien]
0.3 (2015-07-14)
----------------
- Corrected default value
[sgeulette]
- Little optimization
[sgeulette]
0.2 (2015-06-18)
----------------
- Added field `role_bypassing_talcondition` to define who can bypass the condition
[anuyens]
- Added translations for new field
[gbastien]
0.1 (2015-06-01)
----------------
- Initial release.
[IMIO]
Raw data
{
"_id": null,
"home_page": "http://pypi.python.org/pypi/collective.behavior.talcondition",
"name": "collective.behavior.talcondition",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "Python Zope Plone",
"author": "IMIO",
"author_email": "dev@imio.be",
"download_url": "https://files.pythonhosted.org/packages/7b/0e/3d111fc22ec3a854d0f198cb68670b5d1d1e58f4a3f24996c6c05eb1fa4b/collective_behavior_talcondition-1.0.0.tar.gz",
"platform": null,
"description": ".. image:: https://travis-ci.org/collective/collective.behavior.talcondition.svg?branch=master\n :target: https://travis-ci.org/collective/collective.behavior.talcondition\n\n.. image:: https://coveralls.io/repos/collective/collective.behavior.talcondition/badge.png\n :target: https://coveralls.io/r/collective/collective.behavior.talcondition\n\n\n==========================================================================\ncollective.behavior.talcondition\n==========================================================================\n\nThis package works for dexterity (behavior) and archetypes (schema extender).\n\nIt adds two fields on a content type or class:\n\n* tal_condition : enter a `TAL expression <http://docs.zope.org/zope2/zope2book/AppendixC.html>`_ that once evaluated will return 'True' if content should be available. By default, elements 'member', 'context' and 'portal' are available for the expression but the TAL expression context may be extended using the 'extra_expr_ctx' parameter.\n\n* roles_bypassing_talcondition : choose the different roles for which the TAL condition will not be evaluated and always considered \\'True\\'\n\nIt's then possible to use the 'evaluate' method to test the TAL condition.\n\nHow to use it\n=============\n\nFor AT you have to provide the ITALConditionable on your class (see testing.zcml).\n\nFor DX you just have to activate the behavior on your content type.\n\nPlone versions\n==============\nIt has been developed and tested for Plone 4 and 5.\n\n\nTranslations\n============\n\nThis product has been translated into\n\n- French.\n\n- Spanish.\n\nYou can contribute for any message missing or other new languages, join us at `Plone Collective Team <https://www.transifex.com/plone/plone-collective/>`_ into *Transifex.net* service with all world Plone translators community.\n\n\n\nChangelog\n=========\n\n\n1.0.0 (2024-09-18)\n------------------\n\n- Generated universal wheel version.\n [sgeulette]\n\n1.0a2 (2024-09-16)\n------------------\n\n- Fix dict iteration for Python 3\n [laulaz]\n- Updated Makefile\n [sgeulette]\n- Used pyenv in gha\n [sgeulette]\n\n1.0a1 (2023-06-21)\n------------------\n\n- Fix deprecated import AccessControl.class_init instead of App.class_init\n (Plone6 compatibility)\n [boulch]\n- Set simplier setup with Makefile\n [sgeulette]\n\n0.14 (2021-06-29)\n-----------------\n\n- Fix pypi broken package\n [boulch]\n\n\n0.13 (2021-06-29)\n-----------------\n\n- Add uninstall profile\n [boulch]\n- Add Plone6 compatibily\n [boulch]\n\n\n0.12 (2021-04-20)\n-----------------\n\n- Add Transifex.net service integration to manage the translation process.\n [macagua]\n- Add Spanish translation\n [macagua]\n- Do not consider the `archetypes.schemaextender` on Plone5.\n [gbastien]\n- Adapted code (except, implementer) to be Python3 compatible.\n [gbastien]\n- Added parameter `trusted=False` to `utils._evaluateExpression`, this will use\n a trusted expression handler instead the restricted python default.\n [gbastien]\n\n0.11 (2019-05-16)\n-----------------\n\n- Added parameter `raise_on_error` to `utils.evaluateExpressionFor` to raise an\n error when an exception occurs instead returning False.\n [gbastien]\n- Added method `TALCondition.complete_extra_expr_ctx` to the behavior to\n formalize the way to get `extra_expr_ctx` to avoid the `evaluate` method\n to be overrided.\n [gbastien]\n\n0.10 (2018-11-20)\n-----------------\n\n- Do not break if parameter `expression` passed to\n `utils._evaluateExpression` is None.\n [gbastien]\n\n0.9 (2018-10-12)\n----------------\n\n- Added new parameter `error_pattern=WRONG_TAL_CONDITION` to\n `utils.evaluateExpressionFor` and underlying `utils._evaluateExpression` to\n be able to log a custom message in case an error occurs during\n expression evaluation.\n [gbastien]\n\n0.8 (2018-06-12)\n----------------\n\n- Mark elements using behavior with `ITALConditionable` interface so it behaves\n like element using the AT extender.\n [gbastien]\n\n0.7 (2017-03-22)\n----------------\n\n- Use CheckBoxWidget for `ITALCondition.roles_bypassing_talcondition` to ease\n selection when displaying several elements.\n [gbastien]\n\n0.6 (2016-01-12)\n----------------\n\n- Added parameter `empty_expr_is_true` to utils._evaluateExpression than may be True\n or False depending that we want an empty expression to be considered True or False.\n Previous behavior is kept in utils.evaluateExpressionFor where an empty expression\n is considered True. This avoid managing an empty expression in the caller method\n [gbastien]\n\n\n0.5 (2015-12-17)\n----------------\n\n- Added method utils._evaluateExpression that receives an expression\n to evaluate, it is called by utils.evaluateExpressionFor. This way, this\n method may evaluate a TAL expression without getting it from the `tal_condition`\n attribute on the context, in case we want to evaluate arbitrary expression\n [gbastien]\n\n\n0.4 (2015-09-16)\n----------------\n\n- Make the tal_condition field larger (from 30 to 80) for the\n AT extender as well as for the DX behavior\n [gbastien]\n- Added possibility to extend TAL expression context by passing\n an `extra_expr_ctx` dict to utils.evaluateExpressionFor, also\n integrated to the `evaluate` method of the DX behavior\n [gbastien]\n\n\n0.3 (2015-07-14)\n----------------\n\n- Corrected default value\n [sgeulette]\n- Little optimization\n [sgeulette]\n\n\n0.2 (2015-06-18)\n----------------\n\n- Added field `role_bypassing_talcondition` to define who can bypass the condition\n [anuyens]\n- Added translations for new field\n [gbastien]\n\n\n0.1 (2015-06-01)\n----------------\n\n- Initial release.\n [IMIO]\n\n\n",
"bugtrack_url": null,
"license": "GPL V2",
"summary": "This package contains a Dexterity behavior and AT schemaextender to add a TAL condition on a content type.",
"version": "1.0.0",
"project_urls": {
"Homepage": "http://pypi.python.org/pypi/collective.behavior.talcondition"
},
"split_keywords": [
"python",
"zope",
"plone"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c54a842be1369f2eeebc54f92daf710c51446db96e34b80b49c039c65af89827",
"md5": "9bf4d2aa97eb65beb9474b724ca83320",
"sha256": "d670ca27e733d2ee14291bb2a200c6c213e3b7dd553097ca56c0446a9f78f1d2"
},
"downloads": -1,
"filename": "collective.behavior.talcondition-1.0.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "9bf4d2aa97eb65beb9474b724ca83320",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 22907,
"upload_time": "2024-09-18T10:54:50",
"upload_time_iso_8601": "2024-09-18T10:54:50.575825Z",
"url": "https://files.pythonhosted.org/packages/c5/4a/842be1369f2eeebc54f92daf710c51446db96e34b80b49c039c65af89827/collective.behavior.talcondition-1.0.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7b0e3d111fc22ec3a854d0f198cb68670b5d1d1e58f4a3f24996c6c05eb1fa4b",
"md5": "b6866ec2a8e5fbc83c0694f4fd14ecb3",
"sha256": "342d04f4a597fc21e4afdfaa62117770fd4392e85385ad3b902e46802a2f265b"
},
"downloads": -1,
"filename": "collective_behavior_talcondition-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "b6866ec2a8e5fbc83c0694f4fd14ecb3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 23833,
"upload_time": "2024-09-18T10:54:51",
"upload_time_iso_8601": "2024-09-18T10:54:51.814482Z",
"url": "https://files.pythonhosted.org/packages/7b/0e/3d111fc22ec3a854d0f198cb68670b5d1d1e58f4a3f24996c6c05eb1fa4b/collective_behavior_talcondition-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-18 10:54:51",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "collective.behavior.talcondition"
}