initial commit
This commit is contained in:
0
apps/dict/fragment/__init__.py
Normal file
0
apps/dict/fragment/__init__.py
Normal file
BIN
apps/dict/fragment/__pycache__/__init__.cpython-313.pyc
Normal file
BIN
apps/dict/fragment/__pycache__/__init__.cpython-313.pyc
Normal file
Binary file not shown.
BIN
apps/dict/fragment/__pycache__/__init__.cpython-38.pyc
Normal file
BIN
apps/dict/fragment/__pycache__/__init__.cpython-38.pyc
Normal file
Binary file not shown.
BIN
apps/dict/fragment/__pycache__/enums.cpython-313.pyc
Normal file
BIN
apps/dict/fragment/__pycache__/enums.cpython-313.pyc
Normal file
Binary file not shown.
BIN
apps/dict/fragment/__pycache__/enums.cpython-38.pyc
Normal file
BIN
apps/dict/fragment/__pycache__/enums.cpython-38.pyc
Normal file
Binary file not shown.
16
apps/dict/fragment/enums.py
Normal file
16
apps/dict/fragment/enums.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from enum import Enum, unique
|
||||
|
||||
# 产品文档名称
|
||||
@unique
|
||||
class DocNameEnum(Enum):
|
||||
dg = 1
|
||||
sm = 2
|
||||
jl = 3
|
||||
hsm = 4
|
||||
hjl = 5
|
||||
bg = 6
|
||||
wtd = 7
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(DocNameEnum.dg)
|
||||
print(DocNameEnum.dg.value)
|
||||
12
apps/dict/fragment/fragmentOperation.py
Normal file
12
apps/dict/fragment/fragmentOperation.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# 该类主要传入文档片段列表,对列表进行数据组装等工作
|
||||
from django.db.models import QuerySet
|
||||
# Models
|
||||
from apps.dict.models import Fragment
|
||||
|
||||
class FragmentOperation(object):
|
||||
def __init__(self, fragments: QuerySet[Fragment] = None):
|
||||
self.__fragments = fragments # 初始化必须:传入Fragment-Model对象
|
||||
|
||||
@property
|
||||
def fragment(self):
|
||||
return self.__fragments
|
||||
Reference in New Issue
Block a user