Esempio n. 1
0
def update_pet(body, id, name, category, photo_urls, tags,
               status):  # noqa: E501
    """Update an existing pet

    Update an existing pet by Id # noqa: E501

    :param body: Update an existent pet in the store
    :type body: dict | bytes
    :param id: 
    :type id: int
    :param name: 
    :type name: str
    :param category: 
    :type category: dict | bytes
    :param photo_urls: 
    :type photo_urls: List[str]
    :param tags: 
    :type tags: list | bytes
    :param status: 
    :type status: str

    :rtype: Pet
    """
    if connexion.request.is_json:
        body = Pet.from_dict(connexion.request.get_json())  # noqa: E501
    if connexion.request.is_json:
        category = Category.from_dict(
            connexion.request.get_json())  # noqa: E501
    if connexion.request.is_json:
        tags = [Tag.from_dict(d)
                for d in connexion.request.get_json()]  # noqa: E501
    return 'do some magic!'
Esempio n. 2
0
def update_cat(body):  # noqa: E501
    """Promeni postojecu kategoriju

     # noqa: E501

    :param body: Objekat za kategoriju koji treba da se doda u bazu
    :type body: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        body = Category.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'
Esempio n. 3
0
def add_cat(body):  # noqa: E501
    """Dodaj novu kategoriju

     # noqa: E501

    :param body: Objekat za kategoriju koji treba da se doda u bazu
    :type body: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        body = Category.from_dict(connexion.request.get_json())  # noqa: E501

    db_session.add(orm.Category(body.name))
    db_session.commit()
    return NoContent, 201