diff options
| author | Barry Warsaw | 2015-04-13 17:26:52 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2015-04-13 17:26:52 -0400 |
| commit | 3126d190d9c8a9b37da952cba42ea6e3b838a2c3 (patch) | |
| tree | e3880168ba50883c4c63854c3f80d481bfbabcbb /src | |
| parent | 2b9ef541cf80e5bcf413c2ba234856a7bc77baad (diff) | |
| download | mailman-3126d190d9c8a9b37da952cba42ea6e3b838a2c3.tar.gz mailman-3126d190d9c8a9b37da952cba42ea6e3b838a2c3.tar.zst mailman-3126d190d9c8a9b37da952cba42ea6e3b838a2c3.zip | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/mailman/interfaces/pending.py | 3 | ||||
| -rw-r--r-- | src/mailman/model/docs/pending.rst | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/mailman/interfaces/pending.py b/src/mailman/interfaces/pending.py index 9907aa779..09c8b44cb 100644 --- a/src/mailman/interfaces/pending.py +++ b/src/mailman/interfaces/pending.py @@ -94,3 +94,6 @@ class IPendings(Interface): def evict(): """Remove all pended items whose lifetime has expired.""" + + def count(): + """The number of pendables in the pendings database.""" diff --git a/src/mailman/model/docs/pending.rst b/src/mailman/model/docs/pending.rst index a634322a1..11335f054 100644 --- a/src/mailman/model/docs/pending.rst +++ b/src/mailman/model/docs/pending.rst @@ -13,6 +13,11 @@ In order to pend an event, you first need a pending database. >>> from zope.component import getUtility >>> pendingdb = getUtility(IPendings) +There are nothing in the pendings database. + + >>> pendingdb.count() + 0 + The pending database can add any ``IPendable`` to the database, returning a token that can be used in urls and such. :: @@ -33,6 +38,11 @@ token that can be used in urls and such. >>> len(token) 40 +There's exactly one entry in the pendings database now. + + >>> pendingdb.count() + 1 + There's not much you can do with tokens except to *confirm* them, which basically means returning the `IPendable` structure (as a dictionary) from the database that matches the token. If the token isn't in the database, None is |
