summaryrefslogtreecommitdiff
path: root/src/mailman/model/docs/domains.rst
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/model/docs/domains.rst')
-rw-r--r--src/mailman/model/docs/domains.rst23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mailman/model/docs/domains.rst b/src/mailman/model/docs/domains.rst
index 4fa39aa2f..924ab7301 100644
--- a/src/mailman/model/docs/domains.rst
+++ b/src/mailman/model/docs/domains.rst
@@ -71,6 +71,29 @@ Domains can have explicit descriptions and contact addresses.
base_url: http://lists.example.net,
contact_address: postmaster@example.com>
+Domains can list all associated mailing lists with the mailing_lists
+property.
+::
+
+ >>> def show_lists(domain):
+ ... mlists = list(domain.mailing_lists)
+ ... for mlist in mlists:
+ ... print mlist
+ ... if len(mlists) == 0:
+ ... print "no lists"
+
+ >>> net_domain = manager['example.net']
+ >>> com_domain = manager['example.com']
+ >>> show_lists(net_domain)
+ no lists
+ >>> create_list('test@example.net')
+ <mailing list "test@example.net" at ...>
+ >>> transaction.commit()
+ >>> show_lists(net_domain)
+ <mailing list "test@example.net" at ...>
+ >>> show_lists(com_domain)
+ no lists
+
In the global domain manager, domains are indexed by their email host name.
::