-
Notifications
You must be signed in to change notification settings - Fork 15
/
listComp.py
29 lines (27 loc) · 1.03 KB
/
listComp.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
28
29
from tkinter import *
from tkinter.ttk import *
from db import DBConnect
import sqlite3
class ListComp:
def __init__(self):
self._dbconnect = DBConnect()
self._dbconnect.row_factory = sqlite3.Row
self._root = Tk()
self._root.title('List of Complaints')
tv = Treeview(self._root)
tv.pack()
tv.heading('#0', text='ID')
tv.configure(column=('#Name', '#Gender','#Phone No.','#Adhar No.', '#Comment'))
tv.heading('#Name', text='Name')
tv.heading('#Gender', text='Gender')
tv.heading('#Phone No.', text='Phone No.')
tv.heading('#Adhar No.', text='Adhar No.')
tv.heading('#Comment', text='Comment')
cursor = self._dbconnect.ListRequest()
for row in cursor:
tv.insert('', 'end', '#{}'.format(row['ID']),text=row['ID'])
tv.set('#{}'.format(row['ID']),'#Name',row['Name'])
tv.set('#{}'.format(row['ID']),'#Gender',row['Gender'])
tv.set('#{}'.format(row['ID']),'#Phone No.',row['Phone_No'])
tv.set('#{}'.format(row['ID']),'#Adhar No.',row['Adhar_No'])
tv.set('#{}'.format(row['ID']),'#Comment',row['Comment'])