-
Notifications
You must be signed in to change notification settings - Fork 1
/
deletes.py
32 lines (25 loc) · 1.23 KB
/
deletes.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
30
31
32
from src.data_base.create_db import BaseDBPart
class DeleteDB(BaseDBPart):
async def delete_admins(self, user_id):
await self.cur.execute("DELETE FROM admin WHERE user_id = ?", (user_id,))
return await self.base.commit()
async def delete_photo(self, name_photo):
await self.cur.execute("DELETE FROM photo WHERE name_photo = ?", (name_photo,))
return await self.base.commit()
async def delete_student(self, user_id):
await self.cur.execute("DELETE FROM student WHERE user_id = ?", (user_id,))
return await self.base.commit()
async def delete_student_from_group(self, group):
await self.cur.execute("DELETE FROM student WHERE group_student = ?", (group,))
return await self.base.commit()
async def delete_student_group_photo(self, student_group):
await self.cur.execute(
"UPDATE `student_group` SET photo = NULL, date = NULL WHERE name_group = ?",
(student_group,),
)
return await self.base.commit()
async def delete_student_group(self, student_group):
await self.cur.execute(
"DELETE FROM student_group WHERE name_group = ?", (student_group,)
)
return await self.base.commit()