Beispiel #1
0
    def create_user(self):
        if self.email and self.password:
            self.password = generate_password_hash(self.password,
                                                   method='sha256')
            register_query = f"INSERT INTO users (email, password) VALUES ('{ self.email }', '{ self.password }');"

            register_con = DbCon(register_query)
            register_con.single_execute()
        else:
            return
Beispiel #2
0
    def del_url(self):
        del_existing = f"DELETE FROM urls WHERE short = '{self.short}' AND long = '{self.long}';"

        del_con = DbCon(del_existing)
        del_con.single_execute()
Beispiel #3
0
    def add_url(self):
        add_new = f"INSERT INTO urls(long, short, userID) VALUES('{ self.long }', '{ self.short }, { self.creator }');"

        add_con = DbCon(add_new)
        add_con.single_execute()