Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Returns the user level as int. """ else:
""" Function to know if a user is part of a specific group. """ # before: # When we were using the standard django model # return user.groups.filter(name=group_name).exists()
""" Function to clean the route as it is stored in the viewsets.
:param route: string :return: string """
# Remove required parameters # Clean the string
previous_link = self.get_previous_link() next_link = self.get_next_link()
return Response( dict( first=previous_link is None, last=next_link is None, page=self.page.number, pages_count=self.page.paginator.num_pages, links=dict( next=self.get_next_link(), previous=self.get_previous_link() ), number_elements=self.page.paginator.count, page_size=self.page_size, content=data, ) )
# We need to make sure we have the correct user in testing ENV # So we don't use the cache
username="#bot", defaults=dict(email="osef@fl.fr") )[0] global __BOT_USER_CACHE if __BOT_USER_CACHE is None: from base_app.models import User
__BOT_USER_CACHE = User.objects.get(username="#bot") return __BOT_USER_CACHE
updated_by=bot, moderated_by=bot, updated_on=timezone.now(), moderated_on=timezone.now(), )
def revision_bot(): |