summaryrefslogtreecommitdiff
path: root/src/mailman/model/docs
diff options
context:
space:
mode:
authorBarry Warsaw2011-04-19 14:52:16 -0400
committerBarry Warsaw2011-04-19 14:52:16 -0400
commit6b4a3ebc37e5e11d74161fed12b3cf75eca6c339 (patch)
treea9267a6748c5bedeacc88f383f88c435b2f21a91 /src/mailman/model/docs
parent23bed0392f25df18478c01aa991c289b83069307 (diff)
downloadmailman-6b4a3ebc37e5e11d74161fed12b3cf75eca6c339.tar.gz
mailman-6b4a3ebc37e5e11d74161fed12b3cf75eca6c339.tar.zst
mailman-6b4a3ebc37e5e11d74161fed12b3cf75eca6c339.zip
Add REST API for addresses, and change the user REST API to use it where
appropriate. Also: * When an Address instance is created, set its registered_on attribute. * Users may not have a password or real_name, so only include those attributes in the REST API for Users if they are set.
Diffstat (limited to 'src/mailman/model/docs')
-rw-r--r--src/mailman/model/docs/addresses.txt25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/mailman/model/docs/addresses.txt b/src/mailman/model/docs/addresses.txt
index ffbb897ab..01e68c954 100644
--- a/src/mailman/model/docs/addresses.txt
+++ b/src/mailman/model/docs/addresses.txt
@@ -126,31 +126,28 @@ Registration and validation
===========================
Addresses have two dates, the date the address was registered on and the date
-the address was validated on. Neither date is set by default.
+the address was validated on. The former is set when the address is created,
+but the latter must be set explicitly.
>>> address_4 = user_manager.create_address(
... 'dperson@example.com', 'Dan Person')
>>> print address_4.registered_on
- None
+ 2005-08-01 07:49:23
>>> print address_4.verified_on
None
-The registered date takes a Python datetime object.
+The verification date records when the user has completed a mail-back
+verification procedure. It takes a datetime object.
- >>> from datetime import datetime
- >>> address_4.registered_on = datetime(2007, 5, 8, 22, 54, 1)
- >>> print address_4.registered_on
- 2007-05-08 22:54:01
+ >>> from mailman.utilities.datetime import now
+ >>> address_4.verified_on = now()
>>> print address_4.verified_on
- None
+ 2005-08-01 07:49:23
-And of course, you can also set the validation date.
+The address shows the verified status in its repr.
- >>> address_4.verified_on = datetime(2007, 5, 13, 22, 54, 1)
- >>> print address_4.registered_on
- 2007-05-08 22:54:01
- >>> print address_4.verified_on
- 2007-05-13 22:54:01
+ >>> address_4
+ <Address: Dan Person <dperson@example.com> [verified] at ...>
Case-preserved addresses