from myglobal import db,api
from flask_restful import Resource, reqparse, fields, marshal
from models import Usuario
from restful.formatResponse import formatOutput



class RegisterAPI(Resource):

    def __init__(self):
        self.reqparse = reqparse.RequestParser()
        self.reqparse.add_argument('email', type = str, required = True, help = 'No email provided', location = 'json')
        self.reqparse.add_argument('password', type = str, required = True, help = 'No password provided', location = 'json')
        super(RegisterAPI, self).__init__()

    def post(self):
        args = self.reqparse.parse_args()
        email = args['email']
        password = args['password'];
        nuevo_usuario = Usuario(email,password)
        db.session.add(nuevo_usuario)
        db.session.commit()
        return formatOutput(1003), 201


api.add_resource(RegisterAPI, '/registration', endpoint = 'registration')


afe5e08bbc946a81aa67cfe68eccde1a39f8aae2
<mask token>


class RegisterAPI(Resource):
    <mask token>

    def post(self):
        args = self.reqparse.parse_args()
        email = args['email']
        password = args['password']
        nuevo_usuario = Usuario(email, password)
        db.session.add(nuevo_usuario)
        db.session.commit()
        return formatOutput(1003), 201


<mask token>

<mask token>


class RegisterAPI(Resource):

    def __init__(self):
        self.reqparse = reqparse.RequestParser()
        self.reqparse.add_argument('email', type=str, required=True, help=
            'No email provided', location='json')
        self.reqparse.add_argument('password', type=str, required=True,
            help='No password provided', location='json')
        super(RegisterAPI, self).__init__()

    def post(self):
        args = self.reqparse.parse_args()
        email = args['email']
        password = args['password']
        nuevo_usuario = Usuario(email, password)
        db.session.add(nuevo_usuario)
        db.session.commit()
        return formatOutput(1003), 201


<mask token>

<mask token>


class RegisterAPI(Resource):

    def __init__(self):
        self.reqparse = reqparse.RequestParser()
        self.reqparse.add_argument('email', type=str, required=True, help=
            'No email provided', location='json')
        self.reqparse.add_argument('password', type=str, required=True,
            help='No password provided', location='json')
        super(RegisterAPI, self).__init__()

    def post(self):
        args = self.reqparse.parse_args()
        email = args['email']
        password = args['password']
        nuevo_usuario = Usuario(email, password)
        db.session.add(nuevo_usuario)
        db.session.commit()
        return formatOutput(1003), 201


api.add_resource(RegisterAPI, '/registration', endpoint='registration')

from myglobal import db, api
from flask_restful import Resource, reqparse, fields, marshal
from models import Usuario
from restful.formatResponse import formatOutput


class RegisterAPI(Resource):

    def __init__(self):
        self.reqparse = reqparse.RequestParser()
        self.reqparse.add_argument('email', type=str, required=True, help=
            'No email provided', location='json')
        self.reqparse.add_argument('password', type=str, required=True,
            help='No password provided', location='json')
        super(RegisterAPI, self).__init__()

    def post(self):
        args = self.reqparse.parse_args()
        email = args['email']
        password = args['password']
        nuevo_usuario = Usuario(email, password)
        db.session.add(nuevo_usuario)
        db.session.commit()
        return formatOutput(1003), 201


api.add_resource(RegisterAPI, '/registration', endpoint='registration')

from myglobal import db,api
from flask_restful import Resource, reqparse, fields, marshal
from models import Usuario
from restful.formatResponse import formatOutput



class RegisterAPI(Resource):

    def __init__(self):
        self.reqparse = reqparse.RequestParser()
        self.reqparse.add_argument('email', type = str, required = True, help = 'No email provided', location = 'json')
        self.reqparse.add_argument('password', type = str, required = True, help = 'No password provided', location = 'json')
        super(RegisterAPI, self).__init__()

    def post(self):
        args = self.reqparse.parse_args()
        email = args['email']
        password = args['password'];
        nuevo_usuario = Usuario(email,password)
        db.session.add(nuevo_usuario)
        db.session.commit()
        return formatOutput(1003), 201


api.add_resource(RegisterAPI, '/registration', endpoint = 'registration')

