diff options
| author | Barry Warsaw | 2009-06-29 21:30:04 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2009-06-29 21:30:04 -0400 |
| commit | 853060fa5fd453b745b09d991b8053c2024cb079 (patch) | |
| tree | 727e04460a2b2314d3d2d64048a7a9bf29131d25 /src/mailman/interfaces/domain.py | |
| parent | cdc95447d97c43f93e8c4b282f150228a5620703 (diff) | |
| download | mailman-853060fa5fd453b745b09d991b8053c2024cb079.tar.gz mailman-853060fa5fd453b745b09d991b8053c2024cb079.tar.zst mailman-853060fa5fd453b745b09d991b8053c2024cb079.zip | |
Diffstat (limited to 'src/mailman/interfaces/domain.py')
| -rw-r--r-- | src/mailman/interfaces/domain.py | 70 |
1 files changed, 43 insertions, 27 deletions
diff --git a/src/mailman/interfaces/domain.py b/src/mailman/interfaces/domain.py index 773290bc5..0692d21d5 100644 --- a/src/mailman/interfaces/domain.py +++ b/src/mailman/interfaces/domain.py @@ -22,49 +22,54 @@ from __future__ import absolute_import, unicode_literals __metaclass__ = type __all__ = [ 'IDomain', + 'IDomainSet', ] +from lazr.restful.declarations import ( + collection_default_content, export_as_webservice_collection, + export_as_webservice_entry, exported) from zope.interface import Interface, Attribute +from zope.schema import TextLine + +from mailman.i18n import _ class IDomain(Interface): """Interface representing domains.""" - email_host = Attribute( - """The host name for email for this domain. - - :type: string - """) - - url_host = Attribute( - """The host name for the web interface for this domain. - - :type: string - """) - - base_url = Attribute( - """The base url for the Mailman server at this domain. - - The base url includes the scheme and host name. + export_as_webservice_entry() - :type: string - """) + email_host = exported(TextLine( + title=_('Email host name'), + description=_('The host name for email for this domain.'), + )) - description = Attribute( - """The human readable description of the domain name. + url_host = exported(TextLine( + title=_('Web host name'), + description=_('The host name for the web interface for this domain.') + )) - :type: string - """) + base_url = exported(TextLine( + title=_('Base URL'), + description=_("""\ + The base url for the Mailman server at this domain, which includes the + scheme and host name."""), + )) - contact_address = Attribute( - """The contact address for the human at this domain. + description = exported(TextLine( + title=_('Description'), + description=_('The human readable description of the domain name.'), + )) - E.g. postmaster@example.com + contact_address = exported(TextLine( + title=_('Contact address'), + description=_("""\ + The contact address for the human at this domain. - :type: string - """) + E.g. postmaster@example.com"""), + )) def confirm_address(token=''): """The address used for various forms of email confirmation. @@ -83,3 +88,14 @@ class IDomain(Interface): :return: The confirmation url. :rtype: string """ + + + +class IDomainSet(Interface): + """The set of all known domains.""" + + export_as_webservice_collection(IDomain) + + @collection_default_content() + def __iter__(): + """Iterate over all domains.""" |
