Пример #1
0
 def post(self):
     environ = Environment()
     content = request.get_json()
     print(content)
     environ.name = content.get('name')
     environ.img = content.get('img')
     environ.key_code = content.get('key_code')
     environ.created_by = content.get('created_by')
     answer = environ.create()
     return jsonify(), 200
Пример #2
0
def create_environment(
    name,
    description=None,
    image=None,
    public=None,
    hidden=None,
    deleted_at=None,
    shareable=None,
    commit=True,
    session=None,
):
    return Environment.create(
        {
            "name": name,
            "description": description,
            "image": image,
            "public": public,
            "hidden": hidden,
            "deleted_at": deleted_at,
            "shareable": shareable,
        },
        commit=commit,
        session=session,
    )