Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move INameFromTitle interface to plone.base #271

Merged
merged 4 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions news/3858.internal.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Mark `INameFromTitle` deprecated, in this distribution,
as it has been moved to `plone.base`.
The deprecation warning is set for Plone 7.0.
[gforcada]
14 changes: 6 additions & 8 deletions plone/app/content/interfaces.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
from zope import schema
from zope.interface import Attribute
from zope.interface import Interface

import zope.deferredimport

class INameFromTitle(Interface):
"""An object that supports gettings it name from its title."""

title = schema.TextLine(
title="Title",
description="A title, which will be converted to a name",
required=True,
)
zope.deferredimport.deprecated(
"It has been moved to plone.base.interfaces. "
"This alias will be removed in Plone 7.0",
INameFromTitle="plone.base.interfaces:INameFromTitle",
)


class IReindexOnModify(Interface):
Expand Down
2 changes: 1 addition & 1 deletion plone/app/content/namechooser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from Acquisition import aq_base
from Acquisition import aq_inner
from plone.app.content.interfaces import INameFromTitle
from plone.base.interfaces import INameFromTitle
from plone.base.utils import check_id
from plone.i18n.normalizer import FILENAME_REGEX
from plone.i18n.normalizer.interfaces import IURLNormalizer
Expand Down
2 changes: 1 addition & 1 deletion plone/app/content/namechooser.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Title-based name chooser
An object can also gain a name based on its title. To do so, the object
must implement or be adaptable to INameFromTitle.

>>> from plone.app.content.interfaces import INameFromTitle
>>> from plone.base.interfaces import INameFromTitle

>>> @implementer(INameFromTitle)
... @adapter(IMyType)
Expand Down