From 44474049c33c8db335aefa3cb45f01727329cdac Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Tue, 24 Jan 2017 15:16:17 +0100 Subject: [PATCH] Added docstrings --- openslides/utils/collection.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/openslides/utils/collection.py b/openslides/utils/collection.py index 697fa2f27..8a0655fb4 100644 --- a/openslides/utils/collection.py +++ b/openslides/utils/collection.py @@ -117,6 +117,9 @@ class CollectionElement: """ Returns a dict that can be sent through the autoupdate system for a site user. + + The argument `user` can be anything, that is allowd as argument for + utils.auth.has_perm(). """ return self.as_autoupdate( 'get_restricted_data', @@ -133,6 +136,9 @@ class CollectionElement: def as_dict_for_user(self, user): """ Returns a dict with the data for a user. Can be used for the rest api. + + The argument `user` can be anything, that is allowd as argument for + utils.auth.has_perm(). """ return self.get_access_permissions().get_restricted_data( self.get_full_data(), @@ -259,6 +265,9 @@ class CollectionElementList(list): def as_autoupdate_for_user(self, user): """ Returns a list of dicts, that can be send though the websocket to a user. + + The argument `user` can be anything, that is allowd as argument for + utils.auth.has_perm(). """ result = [] for element in self: @@ -355,6 +364,9 @@ class Collection: def as_autoupdate_for_user(self, user): """ Returns a list of dicts, that can be send though the websocket to a user. + + The argument `user` can be anything, that is allowd as argument for + utils.auth.has_perm(). """ output = [] for collection_element in self.element_generator(): @@ -367,6 +379,9 @@ class Collection: """ Returns a list of dictonaries to send them to a user, for example over the rest api. + + The argument `user` can be anything, that is allowd as argument for + utils.auth.has_perm(). """ output = [] for collection_element in self.element_generator():