for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
# -*- coding: utf-8 -*-
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
class SomeClass: def some_method(self): """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.
import typing
__author__ = 'damien'
from tracim.models.auth import Group, User
from sqlalchemy.orm import Query
from sqlalchemy.orm import Session
class GroupApi(object):
__class__
def __init__(
self,
session: Session,
current_user: typing.Optional[User],
typing
):
self._user = current_user
self._session = session
def _base_query(self) -> Query:
return self._session.query(Group)
def get_one(self, group_id) -> Group:
return self._base_query().filter(Group.group_id == group_id).one()
def get_one_with_name(self, group_name) -> Group:
return self._base_query().filter(Group.group_name == group_name).one()
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.