Esempio n. 1
0
 def update_timestamp_(self):
     rate_date = str(datetime.datetime.today())
     with conn() as cursor:
         cursor.execute(
             sql.SQL(
                 "update {} set (timestamp_) = (%s) where id_owner = %s and id_product = %s and rate = %s"
             ).format(sql.Identifier(self.owner_product)),
             (rate_date, self.id_owner, self.id_product, self.rate))
     cf.print_('Updated owner_product timestamp_')
Esempio n. 2
0
 def update_timestamp_non_gst_rate(self):
     rate_date = str(datetime.datetime.today())
     with conn() as cursor:
         cursor.execute(
             sql.SQL(
                 "update {} set (timestamp_, rate) = (%s, %s) where id_owner = %s and id_product = %s returning id"
             ).format(sql.Identifier(self.owner_product)),
             (rate_date, self.rate, self.id_owner, self.id_product))
         result = cursor.fetchall()
         if len(result) == 0:
             return 'fail'
     cf.print_('Updated owner_product non_gst_rate and timestamp_ ')