Beispiel #1
0
def create_club(name, description):
    new_club = Club(
        name=name,
        description=description
    )
    db.session.add(new_club)
    db.session.commit()
    return new_club.serialize()
Beispiel #2
0
def create_club():
    post_body = json.loads(request.data)
    name = post_body.get('name', '')
    description = post_body.get('description', '')
    club = Club(name=name, description=description)
    db.session.add(club)
    db.session.commit()
    return json.dumps({'success': True, 'data': club.serialize()}), 200
Beispiel #3
0
def create_club():
    post_body = json.loads(request.data)
    name = post_body.get('name')
    description = post_body.get('description', '')
    level = post_body.get('level')
    application_required = post_body.get('application_required', None)
    category = post_body.get('category')
    href = post_body.get('href', None)
    club = Club(name=name,
                description=description,
                level=level,
                application_required=application_required,
                category=category,
                href=href)
    db.session.add(club)
    db.session.commit()
    return json.dumps({'success': True, 'data': club.serialize()}), 201
Beispiel #4
0
def create_club():
    body = json.loads(request.data)
    name = body['name']
    website = body['website']
    portal = body['portal']
    status = body['status']

    club = Club(
        name=name,
        website=website,
        portal=portal,
        status=status,
    )
    db.session.add(club)
    db.session.commit()

    return json.dumps({"Success": True, "data": club.serialize()}), 201
def create_club(body):
    club = Club(body)

    db.session.add(club)
    db.session.commit()
    return club.serialize()