This repository was archived by the owner on Oct 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Feature/betheprofessional #36
Open
Tert0
wants to merge
81
commits into
develop
Choose a base branch
from
feature/betheprofessional
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
c5259bc
Added new DB Models
Tert0 f699b7f
Updates Parameters
Tert0 6541268
Started Refactoring BeTheProfessional
Tert0 3102fcc
Fixed Model
Tert0 0171654
Fixed Model Primary Key
Tert0 7d8d668
Refactored function and the cog is now runnable
Tert0 d16256a
Added Group to DB Model
Tert0 58de9d3
New Translation
Tert0 dd0a7d3
Fixed bugs, added parent parser, added parents to params
Tert0 6c71d14
Added help for Group/Parent/Topic formating
Tert0 7727363
Fixed trailing comma
Tert0 5068770
Fixed trailing commas
Tert0 a2d8c98
Merge branch 'develop' into feature/betheprofessional
Tert0 cb71c22
Resolved PEP Problem
Tert0 df6cda3
Reformated with black
Tert0 281eaaf
Added group check and fixed unassing_topic command
Tert0 bbebc70
Improved List Feature (not ready with many bugs)
Tert0 5f9e129
Fixed Topic Check command
Tert0 fe70c36
New DB Model
Tert0 49e9511
New List Topics View, removed Group from DB and fixed Register Topic …
Tert0 46a02af
Fixed PEP
Tert0 2abcc71
Reformated with black
Tert0 1f95996
Merge branch 'develop' into feature/betheprofessional
Tert0 9f1d72b
Fixed PEP8
Tert0 171f720
Added new topic ping command
Tert0 eb34e26
Added Role Update and fixed logger
Tert0 79ce872
Refactored with black
Tert0 d9d997a
Fixed Formating
Tert0 54abdcf
Fixed Formating
Tert0 ad768ef
Optimised Import
Tert0 f315a1a
Added Topic Role Update Command
Tert0 c74966b
Merge branch 'develop' into feature/betheprofessional
Tert0 3873480
Fixed BeTheProfessional Update Role and Refactored
Tert0 986ab4e
Merge branch 'develop' into feature/betheprofessional
Tert0 fcd188b
Merge branch 'develop' into feature/betheprofessional
Tert0 c852e94
Made Topic Names complete Unique, Fixed Role Assign, Fixed Role Delete
Tert0 ce73f33
Fix PEP8
Tert0 da6e7eb
Merge branch 'develop' into feature/betheprofessional
Tert0 433fc67
Fixed DB Models, Updated Command Descriptions, Improved Top Topic Rol…
Tert0 2b4f90d
Added BTP Leaderboard Command
Tert0 23732c7
Added Redis Leaderboard Cache, Added Bypass Cache Permission, Added B…
Tert0 4ca2a3c
Refactored Code
Tert0 7c5f7bd
Reformatted with black
Tert0 6edfe58
PEP8
Tert0 f877b28
PEP8
Tert0 16dd9df
Trailing Comma
Tert0 3e30daa
Merge branch 'develop' into feature/betheprofessional
Tert0 8c9c3c7
Added Docs
Tert0 8353218
Merge remote-tracking branch 'origin/feature/betheprofessional' into …
Tert0 9e01906
Fixed MD Style
Tert0 64bb3f6
Fixed Role Update Loop + Reload Command, Added BTP Main Command, Adde…
Tert0 1254e49
Added read Permission and Permission Check, Added new commands to the…
Tert0 45666b6
Fixed recursive Topic delition
Tert0 3b65996
Implemented Signle (Un)Assign Help
Tert0 7aac1c9
Added reset for redis counter
Tert0 9c18006
Added missing awaits, Added usertopic command
Tert0 0718aa4
Added usertopics command docs
Tert0 4562c42
Reformatted with black
Tert0 ffeb298
Added Pagigantion and improved LB
Tert0 0fe9d4d
Merge branch 'develop' into feature/betheprofessional
Tert0 ae944d9
fixed documentation code style
Tert0 c8ef56f
optimized role update loop
Tert0 a417253
added second sort to role update loop
Tert0 8a4ea1c
Merge develop into feature/betheprofessional
Defelo cf790df
added TODOs
TheCataliasTNT2k b5d33c3
Removed typing import
Tert0 c446584
Resolved some TODO's
Tert0 38ffb81
Resolved some TODO's
Tert0 8f9988a
Merge branch 'v3.3' into feature/betheprofessional
Tert0 aa6202f
Added DB Relationships
Tert0 6be0b2f
Merge branch 'develop' into feature/betheprofessional
Tert0 e42986d
fix after merge
Tert0 5523e69
added confirmation on topic unregister and fixed codestyle stuff
Tert0 a91bccc
sorted imports
Tert0 0cea283
black+isort auto format
Tert0 51d3f4a
Merge branch 'develop' into feature/betheprofessional
Tert0 055793a
added assignable parameter, rewrote update roles logic and improved c…
Tert0 bab1770
Changed BTP Settings
Tert0 a2a0a91
fixed linter
Tert0 3ff8eba
resolved todos
Tert0 1924e3f
added a few todos
TheCataliasTNT2k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,39 @@ | ||
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.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
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.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
name: Union[Column, str] = Column(String(255)) | ||
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
parent: Union[Column, int] = Column(Integer) | ||
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
role_id: Union[Column, int] = Column(BigInteger) | ||
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
group: Union[Column, str] = Column(String(255)) | ||
|
||
@staticmethod | ||
async def create(role_id: int) -> "BTPRole": | ||
row = BTPRole(role_id=role_id) | ||
async def create( | ||
name: str, | ||
role_id: Union[int, None], | ||
group: str, | ||
parent: Optional[Union[int, None]], | ||
) -> "BTPTopic": | ||
row = BTPTopic(name=name, role_id=role_id, parent=parent, group=group) | ||
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.
Outdated
Show resolved
Hide resolved
|
||
__tablename__ = "btp_users" | ||
|
||
id: Union[Column, int] = Column(Integer, primary_key=True) | ||
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
user_id: Union[Column, int] = Column(BigInteger) | ||
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
topic: Union[Column, int] = Column(Integer, ForeignKey(BTPTopic.id)) | ||
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Tert0 marked this conversation as resolved.
Outdated
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.