Skip to content

Commit 8ee0247

Browse files
committed
chore: wip
1 parent d2cd76d commit 8ee0247

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/quark/component/form/fields/transfer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import Dict, List, Optional, Any
1+
from typing import Any, Dict, List, Optional
2+
23
from .base import Base
34

45

@@ -14,8 +15,8 @@ class DataSource(Base):
1415
"""
1516

1617
key: Any = None
17-
title: str = ""
18-
description: str = ""
18+
title: Optional[str] = None
19+
description: Optional[str] = None
1920
disabled: bool = False
2021

2122

src/quark/services/permission.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from quark.models.menu_has_permission import MenuHasPermission
44

5+
from ..component.form.fields.transfer import DataSource
56
from ..models.permission import Permission
67

78

@@ -20,11 +21,11 @@ async def list(self):
2021
async def data_source(self):
2122
permissions = await Permission.all()
2223
data_source = [
23-
{
24-
"key": permission.id,
25-
"title": permission.name,
26-
"description": permission.remark,
27-
}
24+
DataSource(
25+
key=permission.id,
26+
title=permission.name,
27+
description=permission.remark,
28+
)
2829
for permission in permissions
2930
]
3031
return data_source

0 commit comments

Comments
 (0)