예제 #1
0
파일: context.py 프로젝트: UPCnet/max
 def removeActivities(self, logical=False):
     """
         Removes all activity posted to a context. If logical is set to True
         Activities are not actually deleted, only marked as not visible
     """
     activitydb = MADMaxCollection(self.request, self.activity_storage)
     which_to_delete = {"contexts.{}".format(self.unique.lstrip("_")): self.getIdentifier()}
     activitydb.remove(which_to_delete, logical=logical)
예제 #2
0
    def delete_tokens(self, platform=None):
        """
            Deletes tokens from a user, filtered by platform if any
        """
        tokens = MADMaxCollection(self.request, 'tokens')
        query = {
            '_owner': self['_owner'],
        }

        if platform is not None:
            query['platform'] = platform

        tokens.remove(query)