diff options
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 |
