SHARE
TWEET

Untitled

a guest Apr 21st, 2019 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def filter_button(self):
  2.  
  3.         name = self.nameEdit.text()
  4.         description_keyword = self.descriptionKeyword.text()
  5.         start_date = self.startDate.text()
  6.         end_date = self.endDate.text()
  7.         duration_low = self.duration1.text()
  8.         duration_high = self.duration2.text()
  9.         totalvisits_low = self.visits1.text()
  10.         totalvists_high = self.visits2.text()
  11.         revenue_low = self.rev1.text()
  12.         revenue_high = self.rev2.text()
  13.  
  14.  
  15.         connection = pymysql.connect(host="localhost",
  16.                                     user="root",
  17.                                     password="12345678",
  18.                                     db="beltline")
  19.         cursor = connection.cursor()
  20.         filterquery = f"select event.name, count(distinct assignto.employeeid, assignto.startdate) as StaffCount, DATEDIFF(event.EndDate, event.StartDate) + 1 as Duration, count(visitevent.username) as TotalVisits, count(visitevent.username)*event.price as TotalRevenue from event join assignto on assignto.name = event.name join visitevent on visitevent.name = event.name  group by event.name"
  21.         df = pd.read_sql(filterquery, connection)
  22.         model = PandasModel(df)
  23.         self.tableView.setModel(model)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top