generated from BYUIDSS/blank_project_repository
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmirage.py
27 lines (21 loc) · 930 Bytes
/
mirage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import pandas as pd
class mirage:
def __init__(self, cvcursor, cvconn):
self.cvcursor = cvcursor
self.cvconn = cvconn
def insert_mirage(self, mirage):
self.cvcursor.execute('INSERT INTO mirage (mirage_build_out) VALUES (%s)', (mirage,))
self.cvconn.commit()
def select_mirage(self):
self.cvcursor.execute('SELECT * FROM mirage')
return self.cvcursor.fetchall()
def display_mirage(self):
df = pd.DataFrame(self.select_mirage())
df.columns = ['Mirage ID', 'Mirage']
return df
def update_mirage(self, mirage_id, mirage):
self.cvcursor.execute('UPDATE mirage SET mirage_build_out = %s WHERE mirage_build_out = %s', (mirage, mirage_id))
self.cvconn.commit()
def delete_mirage(self, mirage_id):
self.cvcursor.execute('DELETE FROM mirage WHERE mirage_id = %s', (mirage_id,))
self.cvconn.commit()