mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-09 02:46:52 +08:00
chore: apply ruff's pyupgrade linter rules to modernize Python code with targeted version (#2419)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import enum
|
||||
import json
|
||||
from typing import List
|
||||
|
||||
from flask_login import UserMixin
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
@@ -96,7 +95,7 @@ class Account(UserMixin, db.Model):
|
||||
one_or_none()
|
||||
return None
|
||||
|
||||
def get_integrates(self) -> List[db.Model]:
|
||||
def get_integrates(self) -> list[db.Model]:
|
||||
ai = db.Model
|
||||
return db.session.query(ai).filter(
|
||||
ai.account_id == self.id
|
||||
@@ -121,7 +120,7 @@ class Tenant(db.Model):
|
||||
created_at = db.Column(db.DateTime, nullable=False, server_default=db.text('CURRENT_TIMESTAMP(0)'))
|
||||
updated_at = db.Column(db.DateTime, nullable=False, server_default=db.text('CURRENT_TIMESTAMP(0)'))
|
||||
|
||||
def get_accounts(self) -> List[db.Model]:
|
||||
def get_accounts(self) -> list[db.Model]:
|
||||
Account = db.Model
|
||||
return db.session.query(Account).filter(
|
||||
Account.id == TenantAccountJoin.account_id,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import json
|
||||
from typing import List
|
||||
|
||||
from sqlalchemy import ForeignKey
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
@@ -117,7 +116,7 @@ class ApiToolProvider(db.Model):
|
||||
return ApiProviderSchemaType.value_of(self.schema_type_str)
|
||||
|
||||
@property
|
||||
def tools(self) -> List[ApiBasedToolBundle]:
|
||||
def tools(self) -> list[ApiBasedToolBundle]:
|
||||
return [ApiBasedToolBundle(**tool) for tool in json.loads(self.tools_str)]
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user