generated from BYUIDSS/blank_project_repository
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnew_window_screen.py
28 lines (21 loc) · 1.11 KB
/
new_window_screen.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 new_window_screen:
def __init__(self, cvcursor, cvconn):
self.cvcursor = cvcursor
self.cvconn = cvconn
def insert_new_window_screen(self, width_inch, height_inch):
self.cvcursor.execute('INSERT INTO new_window_screen (width_inch, height_inch) VALUES (%s)', (width_inch, height_inch,))
self.cvconn.commit()
def select_new_window_screen(self):
self.cvcursor.execute('SELECT * FROM new_window_screen')
return self.cvcursor.fetchall()
def display_new_window_screen(self):
df = pd.DataFrame(self.select_new_window_screen())
df.columns = ['NWS Id', 'Width Inch', 'Height Inch']
return df
def update_new_window_screen(self, nws_id, width_inch, height_inch):
self.cvcursor.execute('UPDATE new_window_screen SET width_inch = %s, height_inch = %s WHERE nws_id = %s', (width_inch, height_inch, nws_id,))
self.cvconn.commit()
def delete_new_window_screen(self, nws_id):
self.cvcursor.execute('DELETE FROM new_window_screen WHERE nws_id = %s', (nws_id,))
self.cvconn.commit()