Beispiel #1
0
    def removeAssociation(self, server_url, handle):
        """
        This method removes the matching association if it's found, and returns
        whether the association was removed or not.
        """

        query = Association.gql('WHERE url = :1 AND handle = :2',
                                server_url, handle)
        return self._delete_first(query)
Beispiel #2
0
    def cleanupAssociations(self):
        """Remove expired associations from the store.

        This method is not called in the normal operation of the
        library.  It provides a way for store admins to keep
        their storage from filling up with expired data.

        @return: the number of associations expired.
        @returntype: int
        """
        query = Association.gql('WHERE created < :1', self._expiration_datetime())
        return self._cleanup_batch(query)