lint
This commit is contained in:
parent
6df0083842
commit
10ffdff2c3
14 changed files with 46 additions and 16 deletions
|
@ -57,7 +57,7 @@ class Webhook(AbstractConfiguration):
|
|||
product="notify",
|
||||
provider=self.format,
|
||||
resource_type="conf",
|
||||
resource_id=self.id
|
||||
resource_id=str(self.id)
|
||||
)
|
||||
|
||||
def send(self, text: str) -> None:
|
||||
|
|
|
@ -51,5 +51,5 @@ class AutomationLogs(AbstractResource):
|
|||
product="core",
|
||||
provider="",
|
||||
resource_type="automationlog",
|
||||
resource_id=self.id
|
||||
resource_id=str(self.id)
|
||||
)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from datetime import datetime
|
||||
from typing import List
|
||||
|
||||
from app.brm.brn import BRN
|
||||
from app.extensions import db
|
||||
from app.models import AbstractConfiguration
|
||||
|
||||
|
@ -22,6 +23,16 @@ class Group(AbstractConfiguration):
|
|||
"group_name", "eotk"
|
||||
]
|
||||
|
||||
@property
|
||||
def brn(self) -> BRN:
|
||||
return BRN(
|
||||
group_id=self.id,
|
||||
product="group",
|
||||
provider="",
|
||||
resource_type="group",
|
||||
resource_id=str(self.id)
|
||||
)
|
||||
|
||||
|
||||
class Pool(AbstractConfiguration):
|
||||
pool_name = db.Column(db.String(80), unique=True, nullable=False)
|
||||
|
@ -38,6 +49,16 @@ class Pool(AbstractConfiguration):
|
|||
lists = db.relationship("MirrorList", back_populates="pool")
|
||||
groups = db.relationship("Group", secondary="pool_group", back_populates="pools")
|
||||
|
||||
@property
|
||||
def brn(self) -> BRN:
|
||||
return BRN(
|
||||
group_id=0,
|
||||
product="pool",
|
||||
provider="",
|
||||
resource_type="pool",
|
||||
resource_id=str(self.pool_name)
|
||||
)
|
||||
|
||||
|
||||
class PoolGroup(db.Model): # type: ignore[name-defined,misc]
|
||||
pool_id = db.Column(db.Integer, db.ForeignKey("pool.id"), primary_key=True)
|
||||
|
@ -98,3 +119,13 @@ class MirrorList(AbstractConfiguration):
|
|||
return super().csv_header() + [
|
||||
"provider", "format", "container", "branch", "filename"
|
||||
]
|
||||
|
||||
@property
|
||||
def brn(self) -> BRN:
|
||||
return BRN(
|
||||
group_id=0,
|
||||
product="list",
|
||||
provider=self.provider,
|
||||
resource_type="list",
|
||||
resource_id=str(self.id)
|
||||
)
|
||||
|
|
|
@ -67,7 +67,7 @@ class Proxy(AbstractResource):
|
|||
product="mirror",
|
||||
provider=self.provider,
|
||||
resource_type="proxy",
|
||||
resource_id=self.id
|
||||
resource_id=str(self.id)
|
||||
)
|
||||
|
||||
@classmethod
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue