Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Feature/betheprofessional #36

Open
wants to merge 81 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
c5259bc
Added new DB Models
Tert0 Jun 19, 2021
f699b7f
Updates Parameters
Tert0 Jun 19, 2021
6541268
Started Refactoring BeTheProfessional
Tert0 Jun 19, 2021
3102fcc
Fixed Model
Tert0 Jun 19, 2021
0171654
Fixed Model Primary Key
Tert0 Jun 19, 2021
7d8d668
Refactored function and the cog is now runnable
Tert0 Jun 19, 2021
d16256a
Added Group to DB Model
Tert0 Jun 20, 2021
58de9d3
New Translation
Tert0 Jun 20, 2021
dd0a7d3
Fixed bugs, added parent parser, added parents to params
Tert0 Jun 20, 2021
6c71d14
Added help for Group/Parent/Topic formating
Tert0 Jun 20, 2021
7727363
Fixed trailing comma
Tert0 Jun 20, 2021
5068770
Fixed trailing commas
Tert0 Jun 20, 2021
a2d8c98
Merge branch 'develop' into feature/betheprofessional
Tert0 Jun 20, 2021
cb71c22
Resolved PEP Problem
Tert0 Jun 20, 2021
df6cda3
Reformated with black
Tert0 Jun 20, 2021
281eaaf
Added group check and fixed unassing_topic command
Tert0 Jun 20, 2021
bbebc70
Improved List Feature (not ready with many bugs)
Tert0 Jun 20, 2021
5f9e129
Fixed Topic Check command
Tert0 Jun 20, 2021
fe70c36
New DB Model
Tert0 Jun 25, 2021
49e9511
New List Topics View, removed Group from DB and fixed Register Topic …
Tert0 Jun 25, 2021
46a02af
Fixed PEP
Tert0 Jun 25, 2021
2abcc71
Reformated with black
Tert0 Jun 25, 2021
1f95996
Merge branch 'develop' into feature/betheprofessional
Tert0 Jun 25, 2021
9f1d72b
Fixed PEP8
Tert0 Jun 25, 2021
171f720
Added new topic ping command
Tert0 Jun 25, 2021
eb34e26
Added Role Update and fixed logger
Tert0 Jun 25, 2021
79ce872
Refactored with black
Tert0 Jun 25, 2021
d9d997a
Fixed Formating
Tert0 Jun 25, 2021
54abdcf
Fixed Formating
Tert0 Jun 25, 2021
ad768ef
Optimised Import
Tert0 Jun 25, 2021
f315a1a
Added Topic Role Update Command
Tert0 Jun 26, 2021
c74966b
Merge branch 'develop' into feature/betheprofessional
Tert0 Aug 9, 2021
3873480
Fixed BeTheProfessional Update Role and Refactored
Tert0 Aug 9, 2021
986ab4e
Merge branch 'develop' into feature/betheprofessional
Tert0 Oct 4, 2021
fcd188b
Merge branch 'develop' into feature/betheprofessional
Tert0 Oct 5, 2021
c852e94
Made Topic Names complete Unique, Fixed Role Assign, Fixed Role Delete
Tert0 Oct 5, 2021
ce73f33
Fix PEP8
Tert0 Oct 11, 2021
da6e7eb
Merge branch 'develop' into feature/betheprofessional
Tert0 Jan 5, 2022
433fc67
Fixed DB Models, Updated Command Descriptions, Improved Top Topic Rol…
Tert0 Jan 8, 2022
2b4f90d
Added BTP Leaderboard Command
Tert0 Jan 9, 2022
23732c7
Added Redis Leaderboard Cache, Added Bypass Cache Permission, Added B…
Tert0 Jan 9, 2022
4ca2a3c
Refactored Code
Tert0 Jan 9, 2022
7c5f7bd
Reformatted with black
Tert0 Jan 9, 2022
6edfe58
PEP8
Tert0 Jan 9, 2022
f877b28
PEP8
Tert0 Jan 9, 2022
16dd9df
Trailing Comma
Tert0 Jan 9, 2022
3e30daa
Merge branch 'develop' into feature/betheprofessional
Tert0 Jan 9, 2022
8c9c3c7
Added Docs
Tert0 Jan 9, 2022
8353218
Merge remote-tracking branch 'origin/feature/betheprofessional' into …
Tert0 Jan 9, 2022
9e01906
Fixed MD Style
Tert0 Jan 9, 2022
64bb3f6
Fixed Role Update Loop + Reload Command, Added BTP Main Command, Adde…
Tert0 Jan 9, 2022
1254e49
Added read Permission and Permission Check, Added new commands to the…
Tert0 Jan 9, 2022
45666b6
Fixed recursive Topic delition
Tert0 Jan 9, 2022
3b65996
Implemented Signle (Un)Assign Help
Tert0 Jan 9, 2022
7aac1c9
Added reset for redis counter
Tert0 Jan 9, 2022
9c18006
Added missing awaits, Added usertopic command
Tert0 Jan 9, 2022
0718aa4
Added usertopics command docs
Tert0 Jan 9, 2022
4562c42
Reformatted with black
Tert0 Jan 9, 2022
ffeb298
Added Pagigantion and improved LB
Tert0 Jan 9, 2022
0fe9d4d
Merge branch 'develop' into feature/betheprofessional
Tert0 Mar 1, 2022
ae944d9
fixed documentation code style
Tert0 Mar 1, 2022
c8ef56f
optimized role update loop
Tert0 Mar 1, 2022
a417253
added second sort to role update loop
Tert0 Mar 1, 2022
8a4ea1c
Merge develop into feature/betheprofessional
Defelo Mar 14, 2022
cf790df
added TODOs
TheCataliasTNT2k Apr 8, 2022
b5d33c3
Removed typing import
Tert0 Apr 13, 2022
c446584
Resolved some TODO's
Tert0 Apr 13, 2022
38ffb81
Resolved some TODO's
Tert0 Apr 13, 2022
8f9988a
Merge branch 'v3.3' into feature/betheprofessional
Tert0 May 16, 2022
aa6202f
Added DB Relationships
Tert0 May 16, 2022
6be0b2f
Merge branch 'develop' into feature/betheprofessional
Tert0 May 16, 2022
e42986d
fix after merge
Tert0 May 16, 2022
5523e69
added confirmation on topic unregister and fixed codestyle stuff
Tert0 May 16, 2022
a91bccc
sorted imports
Tert0 May 16, 2022
0cea283
black+isort auto format
Tert0 May 16, 2022
51d3f4a
Merge branch 'develop' into feature/betheprofessional
Tert0 Jul 18, 2022
055793a
added assignable parameter, rewrote update roles logic and improved c…
Tert0 Jul 18, 2022
bab1770
Changed BTP Settings
Tert0 Jul 18, 2022
a2a0a91
fixed linter
Tert0 Jul 18, 2022
3ff8eba
resolved todos
Tert0 Jul 18, 2022
1924e3f
added a few todos
TheCataliasTNT2k Jul 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added new DB Models
  • Loading branch information
Tert0 committed Jun 19, 2021
commit c5259bc8c5c001df07d37fc0f8d26f6aa9b4ccdd
30 changes: 23 additions & 7 deletions general/betheprofessional/models.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
from typing import Union
from typing import Union, Optional

from PyDrocsid.database import db
from sqlalchemy import Column, BigInteger
from sqlalchemy import Column, BigInteger, String, Integer, ForeignKey


class BTPRole(db.Base):
__tablename__ = "btp_role"
class BTPTopic(db.Base):
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
__tablename__ = "btp_topic"

role_id: Union[Column, int] = Column(BigInteger, primary_key=True, unique=True)
id: Union[Column, int] = Column(Integer, primary_key=True)
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
name: Union[Column, str] = Column(String)
parent: Union[Column, int] = Column(Integer)
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
role_id: Union[Column, int] = Column(BigInteger)
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
Tert0 marked this conversation as resolved.
Show resolved Hide resolved

@staticmethod
async def create(role_id: int) -> "BTPRole":
row = BTPRole(role_id=role_id)
async def create(name: str, role_id: int, parent: Optional[int]) -> "BTPTopic":
row = BTPTopic(name=name, role_id=role_id, parent=parent)
await db.add(row)
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
return row


class BTPUser(db.Base):
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
__tablename__ = "btp_users"

user_id: Union[Column, int] = Column(BigInteger, primary_key=True)
topic: Union[Column, int] = Column(Integer, ForeignKey(BTPTopic.id))
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
Tert0 marked this conversation as resolved.
Show resolved Hide resolved
Tert0 marked this conversation as resolved.
Show resolved Hide resolved

@staticmethod
async def create(user_id: int, topic: int) -> "BTPUser":
row = BTPUser(user_id=user_id, topic=topic)
await db.add(row)
return row