Ejemplo n.º 1
0
 def get(self, ride_id):
     try:
         return self.get_single_ride(ride_id)
     except psycopg2.DatabaseError as e:
         if con:
             print(e)
             con.rollback()
             return self.get_single_ride(ride_id)
     except psycopg2.InterfaceError as Ie:
         print(Ie)
         return self.get_single_ride(ride_id)
Ejemplo n.º 2
0
 def get(self):
     try:
         return self.get_ride_offers()
     except psycopg2.DatabaseError as e:
         if con:
             print(e)
             con.rollback()
             return self.get_ride_offers()
     except psycopg2.InterfaceError as Ie:
         print(Ie)
         return self.get_ride_offers()
Ejemplo n.º 3
0
 def post(self):
     try:
         return login()
     except psycopg2.DatabaseError as e:
         print(e)
         if con:
             con.rollback()
             login()
         sys.exit(1)
     except psycopg2.InterfaceError as Ie:
         print(Ie)
         return login()
Ejemplo n.º 4
0
    def put(self, rideId, requestId):
        try:
            return self.accept_or_reject_ridrequest(rideId, requestId)
        except psycopg2.DatabaseError as e:
            if con:
                con.rollback()
                print(e)
                self.accept_or_reject_ridrequest(rideId, requestId)

            sys.exit(1)
        except psycopg2.InterfaceError as Ie:
            print(Ie)
            return self.accept_or_reject_ridrequest(rideId, requestId)
Ejemplo n.º 5
0
    def get(self, rideId):
        try:
            return self.get_rideoffer_requests(rideId)

        except psycopg2.DatabaseError as e:
            if con:
                con.rollback()
                print(e)
                self.get_rideoffer_requests(rideId)

            sys.exit(1)
        except psycopg2.InterfaceError as Ie:
            print(Ie)
            return self.get_rideoffer_requests(rideId)
Ejemplo n.º 6
0
    def post(self):
        try:
            return create_user()

        except psycopg2.DatabaseError as e:
            if con:
                con.rollback()
                print(e)
                create_user()

            sys.exit(1)
        except psycopg2.InterfaceError as Ie:
            print(Ie)
            return create_user()
Ejemplo n.º 7
0
    def post(self):

        try:

            return self.insert_ride_offers()

        except psycopg2.DatabaseError as e:
            if con:
                con.rollback()
                print(e)
                self.insert_ride_offers()

            sys.exit(1)
        except psycopg2.InterfaceError as Ie:
            print(Ie)
            return self.insert_ride_offers()