Advertisement
Guest User

Untitled

a guest
May 9th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. class KindOfCoupons:
  2.  
  3. def get_coupons(self, cur, names):
  4. coupons = {}
  5. for name in names:
  6. coupons[name] = cur.execute("SELECT * FROM "" + name + "" ;")
  7. return coupons
  8.  
  9. def connect_redshift(self):
  10. conn = psycopg2.connect("dbname=dbname host=host user=user password=password port=000")
  11. return conn.cursor()
  12.  
  13. def get_coupon_used_type(self):
  14. cur = self.connect_redshift()
  15. names = ["TABLE", "TABLE_B", "TABLE_C"]
  16. coupons = self.get_coupons(cur, names)
  17. coupons[names[0]][0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement