Beispiel #1
0
def Request_feed():
    if session['logged_in']:
        if request.method == 'GET':
            allreqs = RequestHandler().get_all_requests()
            return render_template("provider.html", Requests=allreqs)
        if request.method == 'POST':
            return RequestHandler().insert_request(request.json)
    else:
        return redirect(url_for('user_login'))
Beispiel #2
0
 def setUp(self):
     self.r1 = [
         1, 'Toilet Paper', 'this is NOT a description', 'home',
         'Requesting', 1
     ]
     self.r2 = [
         2, 'Hand Sanitizer', 'this MAY be a decription', 'Maya',
         'Provided', 3
     ]
     self.r3 = [
         3, 'Food', 'this is POSSIBLY a description', 'laCalle', 'Provided',
         1
     ]
     self.r4 = [
         4, 'send help pls', 'this is ME DOING a description', 'home',
         'Requesting', 3
     ]
     self.r5 = [
         5, 'beer', 'this is JUST a description', 'bar', 'Requesting', 4
     ]
     self.requests: list = [self.r1, self.r2, self.r3, self.r4, self.r5]
     self.user1 = [1, 'Morsa', 'faces4444', '*****@*****.**', '7878598899']
     self.keys = [
         'rid', 'rtitle', 'rdescription', 'rlocation', 'rstatus', 'ruser'
     ]
     self.rh = RequestHandler()
     self.dao = RequestDAO()
     self.daoUSER = UserDAO()
     self.app = Flask(__name__)
    def setUp(self):
        self.r1 = [
            1, 'Toilet Paper', 'this is NOT a description', 'home',
            'Requesting', 1
        ]
        self.r2 = [
            2, 'Hand Sanitizer', 'this MAY be a decription', 'Maya',
            'Provided', 3
        ]
        self.r3 = [
            3, 'Food', 'this is POSSIBLY a description', 'laCalle', 'Provided',
            1
        ]
        self.r4 = [
            4, 'send help pls', 'this is ME DOING a description', 'home',
            'Requesting', 3
        ]
        self.r5 = [
            5, 'beer', 'this is JUST a description', 'bar', 'Requesting', 4
        ]

        self.keys = [
            'rid', 'rtitle', 'rdescription', 'rlocation', 'rstatus', 'ruser'
        ]
        self.rh = RequestHandler()
        self.dao = RequestDAO()
        self.app = Flask(__name__)
Beispiel #4
0
def profile():
    if session['logged_in']:
        if request.method == 'GET':
            user_info = UserHandler().get_user_by_id(session['uid'])
            unf_req = RequestHandler().get_requests_by_user_status(
                session['uid'], 'fuf')
            inprog_req = RequestHandler().get_requests_by_user_status(
                session['uid'], 'unfuf')
            fufld_req = RequestHandler().get_requests_by_user_status(
                session['uid'], 'pending')
            return render_template("userProfile.html",
                                   Info=user_info,
                                   Unf=unf_req,
                                   Inp=inprog_req,
                                   Fuf=fufld_req)

    else:
        return redirect(url_for('user_login'))
Beispiel #5
0
def getreqs():
    if request.method == 'GET':
        allreqs = RequestHandler().get_all_requests()
        return (allreqs)
def Request_feed():
    if request.method == 'GET':
        allreqs = RequestHandler().get_all_requests()
        return render_template("provider.html", Requests=allreqs)