8

Updates docstrings in the utils

This commit is contained in:
Jasper Berghoef
2017-05-22 16:05:29 +02:00
parent 24af956913
commit 4afb643d5e

View File

@@ -2,11 +2,14 @@ import time
def impersonate_other_page(page, other_page):
"""
Function to change the page metadata so the user gets to see the
"""Function to change the page metadata so the user gets to see the
non-personalized path and page.
:param page: The page to be impersonated
:type page: personalisation.models.PersonalisablePage
:param other_page: The page it should impersonate
:type other_page: personalisation.models.PersonalisablePage
"""
page.path = other_page.path
page.depth = other_page.depth
@@ -15,11 +18,13 @@ def impersonate_other_page(page, other_page):
def create_segment_dictionary(segment):
"""
Creates a dictionary with all the required segment
information.
"""Creates a dictionary with all the required segment information.
:param segment: Segment object
:type segment: personalisation.models.Segment
:return: Dictionary with name, id, timestamp and persistent state.
:rtype: dict
"""
return {
"encoded_name": segment.encoded_name(),