예제 #1
0
def movie_remove(mid):
    query.delete("MOVIES", (mid, ))
    return redirect(url_for('movie_list'))
예제 #2
0
def user_remove(mid):
    query.delete("users", (mid, ))
    return redirect(url_for('users_list'))
예제 #3
0
 if op not in operation:
     print('invalid operation')
     continue
 elif op == 'help':
     print('operations:\n help - to view commands\n add - to insert new contact\n delete - to delete contact\n '
           'edit - to update contact\n view - to view all contact\n search - to find the contact\n exit - to exit')
     continue
 elif op == 'exit':
     exit()
 elif op == 'add':
     name = input('enter name: ')
     phone = input('enter phone: ')
     query.add(db, table_name, name=name, phone=phone)
 elif op == 'delete':
     name = input('enter name: ')
     query.delete(db, table_name, name)
 elif op == 'view':
     query.select(db, table_name)
 elif op == 'edit':
     var = input('update name or phone: ')
     if var == 'name':
         phone = input('enter the phone no of which name to be updated: ')
         new_name = input('enter the new name: ')
         query.update(db, table_name, phone=phone, where_name=new_name)
     if var == 'phone':
         name = input('enter the name whose number to be updated: ')
         new_phone = input('enter the new phone no: ')
         query.update(db, table_name, name=name, where_phone=new_phone)
 elif op == 'search':
     att = input('search by name or phone: ')
     if att == 'name':
예제 #4
0
 def delUser(self, i):
     self.cur.execute(q.delete(i))
예제 #5
0
 def delete(self):
     """Deletes from db"""
     query.delete('shares', id=self.id)