Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
F
fund_report
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭熊
fund_report
Commits
bdd373cc
Commit
bdd373cc
authored
Jan 12, 2021
by
pengxiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix2
parent
fc05f494
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
183 additions
and
99 deletions
+183
-99
default_template_params.py
app/config/default_template_params.py
+12
-6
report.py
app/controller/report.py
+19
-52
template_manage.py
app/controller/template_manage.py
+4
-5
tamp_diagnose_app.py
app/model/tamp_diagnose_app.py
+21
-2
template_manage_service.py
app/service/template_manage_service.py
+117
-27
monthReportV2.1.html
app/templates/v2/monthReportV2.1.html
+1
-1
jinjia2html_v2.py
app/utils/jinjia2html_v2.py
+9
-6
No files found.
app/config/default_template_params.py
View file @
bdd373cc
...
...
@@ -45,13 +45,16 @@ hold_default_template = {
'box8': 'block',
'cover_title1': '资产',
'cover_title2': '存续报告',
'logo': img_transfer(template_folder + '/v2/img/logo.png'),
'logo': '',
# 'logo': img_transfer(template_folder + '/v2/img/logo.png'),
'brand_name': '小飞象',
'logo_display': 'block',
'brand_name_display': 'block',
'
cover_back': img_transfer(template_folder + '/v2/img/cover-back.png')
,
#
'
financial_text': '我们挣的是⻆度和变化的钱而不是纠正市场错误的钱,市场永远是正确的,关键是在其正确被反复证明后的逆向而行,一定是避开它的正确被展开的过程。'
,
#
'cover_back': img_transfer(template_folder + '/v2/img/cover-back.png'),
# 'scene': img_transfer(template_folder + '/v2/img/scene.png'),
'cover_back': '',
'scene': '',
# 'team': img_transfer(template_folder + '/v2/img/default-user.png'),
# 'red_rect': img_transfer(template_folder + '/v2/img/red-rect.png'),
# 'sh': img_transfer(template_folder + '/v2/img/sh.png'),
...
...
@@ -93,12 +96,15 @@ diagnose_default_template = {
'box8': 'block',
'cover_title1': '资产',
'cover_title2': '存续报告',
'logo': img_transfer(template_folder + '/v2/img/logo.png'),
'logo': '',
'cover_back': '',
'scene': '',
# 'logo': img_transfer(template_folder + '/v2/img/logo.png'),
'brand_name': '小飞象',
'logo_display': 'block',
'brand_name_display': 'block',
'
cover_back': img_transfer(template_folder + '/v2/img/cover-back.png')
,
#
'
financial_text': '我们挣的是⻆度和变化的钱而不是纠正市场错误的钱,市场永远是正确的,关键是在其正确被反复证明后的逆向而行,一定是避开它的正确被展开的过程。'
,
#
'cover_back': img_transfer(template_folder + '/v2/img/cover-back.png'),
# 'scene': img_transfer(template_folder + '/v2/img/scene.png'),
# 'team': img_transfer(template_folder + '/v2/img/default-user.png'),
# 'red_rect': img_transfer(template_folder + '/v2/img/red-rect.png'),
app/controller/report.py
View file @
bdd373cc
...
...
@@ -16,6 +16,7 @@ from flask import request, render_template
from
flask
import
make_response
from
app.api.engine
import
config
from
app.service.template_manage_service
import
make_report
,
get_make_report_data
from
app.utils.html_to_pdf
import
html_to_pdf
from
app.api.engine
import
pdf_folder
,
redis
,
env
,
TAMP_SQL
,
tamp_diagnose_app_engine
from
app.utils.jinjia2html_v2
import
DataIntegrate
...
...
@@ -26,68 +27,34 @@ class ReportHandlers(Resource):
def
__init__
(
self
):
"""."""
token
=
request
.
headers
.
get
(
'Authorization'
,
''
)
token
=
's:sid:'
+
token
.
split
(
' '
)[
1
]
ifa_id
=
redis
.
get
(
token
)
if
not
ifa_id
:
return
{
"code"
:
'9005'
,
"message"
:
"请登录"
,
"attributes"
:
[]}
self
.
ifa_id
=
ifa_id
.
decode
()
.
replace
(
'
\'
'
,
''
)
self
.
parser
=
reqparse
.
RequestParser
()
def
get
(
self
):
"""."""
# self.parser.add_argument('ifa_id', type=str, required=True, help='ifa_
id不能为空')
"""
获取制作模版数据
."""
self
.
parser
.
add_argument
(
'id'
,
type
=
str
,
required
=
True
,
help
=
'模版
id不能为空'
)
self
.
parser
.
add_argument
(
'customer_id'
,
type
=
str
,
required
=
True
,
help
=
'customer_id不能为空'
)
args
=
self
.
parser
.
parse_args
()
token
=
request
.
headers
.
get
(
'Authorization'
,
''
)
token
=
's:sid:'
+
token
.
split
(
' '
)[
1
]
ifa_id
=
redis
.
get
(
token
)
.
decode
()
if
not
ifa_id
:
return
{
"code"
:
40005
,
"data"
:
None
,
"lang"
:
"zh_CN"
,
"msg"
:
"请登陆"
}
ifa_id
=
ifa_id
.
replace
(
'
\'
'
,
''
)
customer_id
=
args
[
'customer_id'
]
pdf_name
=
str
(
uuid
.
uuid4
())
+
'.pdf'
with
TAMP_SQL
(
tamp_diagnose_app_engine
)
as
tamp_diagnose_app
:
tamp_diagnose_app_session
=
tamp_diagnose_app
.
session
sql
=
"update hold_report set update_time='{}', update_status='{}' where ifa_id='{}' and customer_id='{}'"
.
format
(
datetime
.
datetime
.
now
(),
1
,
ifa_id
,
customer_id
)
tamp_diagnose_app_session
.
execute
(
sql
)
start
=
time
.
time
()
try
:
dt
=
DataIntegrate
(
ifa_id
=
ifa_id
,
customer_id
=
customer_id
,
pdf_name
=
pdf_name
)
dt
.
render_data
()
except
:
pass
print
(
'耗时{}秒'
.
format
(
round
(
time
.
time
()
-
start
,
2
)))
auth
=
oss2
.
Auth
(
config
[
env
][
'oss'
][
'account'
],
config
[
env
][
'oss'
][
'password'
])
# Endpoint以杭州为例,其它Region请按实际情况填写。
bucket
=
oss2
.
Bucket
(
auth
,
'http://oss-cn-shanghai.aliyuncs.com'
,
'tamperdev'
)
# 生成下载文件的签名URL,有效时间为60s。
path
=
bucket
.
sign_url
(
'GET'
,
'productionenv/Start/'
+
pdf_name
,
60
)
with
TAMP_SQL
(
tamp_diagnose_app_engine
)
as
tamp_diagnose_app
:
tamp_diagnose_app_session
=
tamp_diagnose_app
.
session
sql
=
"update hold_report set update_time='{}', update_status='{}', file='{}' where ifa_id='{}' and customer_id='{}'"
.
format
(
datetime
.
datetime
.
now
(),
2
,
pdf_name
,
ifa_id
,
customer_id
)
tamp_diagnose_app_session
.
execute
(
sql
)
args
[
'ifa_id'
]
=
self
.
ifa_id
data
=
get_make_report_data
(
args
)
resp
=
{
"code"
:
0
,
"data"
:
{
"path"
:
path
},
"lang"
:
"zh_CN"
,
"msg"
:
"成功"
"statusCode"
:
"0000"
,
"message"
:
"成功"
,
"attributes"
:
data
}
return
resp
def
post
(
self
):
"""."""
pass
"""制作模版."""
self
.
parser
.
add_argument
(
'customer_id'
,
type
=
str
,
required
=
True
,
help
=
'customer_id不能为空'
)
args
=
self
.
parser
.
parse_args
()
make_report
(
args
)
def
put
(
self
,
id
):
"""."""
...
...
app/controller/template_manage.py
View file @
bdd373cc
...
...
@@ -39,6 +39,7 @@ class TemplateManage(Resource):
"""获取默认模版数据."""
self
.
parser
.
add_argument
(
'type'
,
type
=
int
,
required
=
True
,
help
=
'type不能为空'
)
args
=
self
.
parser
.
parse_args
()
args
[
'ifa_id'
]
=
self
.
ifa_id
data
=
get_default_template
(
args
)
resp
=
{
"statusCode"
:
"0000"
,
...
...
@@ -65,11 +66,9 @@ class TemplateManage(Resource):
def
put
(
self
):
"""更新模版."""
self
.
parser
.
add_argument
(
'update_type'
,
type
=
int
,
required
=
True
,
help
=
'1默认模版2自定义模版'
)
self
.
parser
.
add_argument
(
'type'
,
type
=
int
,
required
=
True
,
help
=
'1持仓报告2诊断报告'
)
self
.
parser
.
add_argument
(
'name'
,
type
=
int
,
required
=
False
,
help
=
'自定义模版名称'
)
self
.
parser
.
add_argument
(
'default_template'
,
type
=
str
,
required
=
False
,
help
=
'模版数据不能为空'
)
self
.
parser
.
add_argument
(
'custom_template'
,
type
=
str
,
required
=
False
,
help
=
'模版数据不能为空'
)
self
.
parser
.
add_argument
(
'id'
,
type
=
str
,
required
=
True
,
help
=
'模版id'
)
# self.parser.add_argument('name', type=int, required=False, help='模版名称')
self
.
parser
.
add_argument
(
'template_data'
,
type
=
str
,
required
=
False
,
help
=
'模版数据'
)
args
=
self
.
parser
.
parse_args
()
args
[
'ifa_id'
]
=
self
.
ifa_id
update_template
(
args
)
...
...
app/model/tamp_diagnose_app.py
View file @
bdd373cc
# coding: utf-8
import
datetime
from
sqlalchemy
import
Column
,
DECIMAL
,
Date
,
DateTime
,
Index
,
String
,
Table
,
Text
,
text
from
sqlalchemy.dialects.mysql
import
BIGINT
,
INTEGER
from
sqlalchemy.ext.declarative
import
declarative_base
from
app.api.engine
import
TAMP_SQL
,
tamp_user_engine
from
app.model.base
import
Base
from
app.model.base
import
BaseModel
...
...
@@ -71,8 +74,8 @@ class FundReportManange(Base, BaseModel):
id
=
Column
(
String
(
64
),
primary_key
=
True
,
comment
=
'id'
)
ifa_id
=
Column
(
String
(
64
),
comment
=
'理财师id'
)
default_template
=
Column
(
String
(
1000
)
,
comment
=
'默认模板'
)
custom_template
=
Column
(
String
(
1000
)
,
comment
=
'自定义模版'
)
default_template
=
Column
(
Text
,
comment
=
'默认模板'
)
custom_template
=
Column
(
Text
,
comment
=
'自定义模版'
)
create_by
=
Column
(
String
(
64
))
create_time
=
Column
(
DateTime
)
update_by
=
Column
(
String
(
64
))
...
...
@@ -81,6 +84,20 @@ class FundReportManange(Base, BaseModel):
name
=
Column
(
String
(
300
),
comment
=
'模版名称'
)
type
=
Column
(
INTEGER
(
2
),
comment
=
'模版类型1持仓报告2诊断报告'
)
def
to_dict
(
self
,
allow_field
=
None
):
all_field
=
[
r
.
name
for
r
in
self
.
__table__
.
columns
]
if
allow_field
:
allow_field
=
set
(
allow_field
)
&
set
(
allow_field
)
else
:
allow_field
=
all_field
data
=
{
c
:
int
(
getattr
(
self
,
c
)
.
timestamp
())
if
isinstance
(
getattr
(
self
,
c
),
datetime
.
datetime
)
else
getattr
(
self
,
c
)
for
c
in
allow_field
}
with
TAMP_SQL
(
tamp_user_engine
)
as
tamp_user
:
tamp_user_session
=
tamp_user
.
session
sql
=
"select ui_username_mp from user_info where id = '{}'"
.
format
(
self
.
ifa_id
)
res
=
tamp_user_session
.
execute
(
sql
)
data
[
'author_name'
]
=
res
.
fetchone
()[
0
]
return
data
class
Group
(
Base
,
BaseModel
):
__tablename__
=
'group'
...
...
@@ -104,6 +121,7 @@ class HoldDiagnoseReport(Base, BaseModel):
update_status
=
Column
(
INTEGER
(
11
))
file
=
Column
(
String
(
128
))
be_viewed
=
Column
(
INTEGER
(
2
),
comment
=
'0未查看1已查看'
)
report_data
=
Column
(
Text
)
class
HoldReport
(
Base
,
BaseModel
):
...
...
@@ -116,6 +134,7 @@ class HoldReport(Base, BaseModel):
update_status
=
Column
(
INTEGER
(
11
))
file
=
Column
(
String
(
128
))
be_viewed
=
Column
(
INTEGER
(
2
),
comment
=
'0未查看1已查看'
)
report_data
=
Column
(
Text
)
class
IfaCustomer
(
Base
,
BaseModel
):
...
...
app/service/template_manage_service.py
View file @
bdd373cc
...
...
@@ -9,6 +9,7 @@
import
datetime
import
json
import
uuid
from
ftfy
import
fix_text
from
sqlalchemy
import
and_
...
...
@@ -16,6 +17,8 @@ from app.api.engine import TAMP_SQL, tamp_diagnose_app_engine
from
app.config.default_template_params
import
hold_default_template
,
hold_default_data
,
diagnose_default_data
,
\
diagnose_default_template
from
app.model.tamp_diagnose_app
import
*
from
app.utils.jinjia2html_v2
import
DataIntegrate
def
get_default_template
(
args
):
""""""
...
...
@@ -27,18 +30,28 @@ def get_default_template(args):
FundReportManange
.
ifa_id
==
args
.
get
(
'ifa_id'
),
FundReportManange
.
type
==
type
,
FundReportManange
.
delete_tag
==
0
,
FundReportManange
.
default_template
is
not
None
FundReportManange
.
default_template
.
isnot
(
None
)
))
.
first
()
if
not
res
:
return
False
default_template
,
default_data
=
None
,
None
if
type
==
1
:
args
[
'name'
]
=
'持仓报告默认模版'
default_template
=
hold_default_template
default_data
=
hold_default_data
elif
type
==
2
:
args
[
'name'
]
=
'诊断报告默认模版'
default_template
=
diagnose_default_template
default_data
=
diagnose_default_data
if
res
:
data
=
{
**
json
.
loads
(
res
.
get
(
'default_template'
)),
**
default_data
}
if
res
.
default_template
:
data
=
{
'id'
:
res
.
id
,
'template_data'
:
{
**
json
.
loads
(
res
.
default_template
),
**
default_data
}
}
else
:
args
[
'id'
]
=
str
(
uuid
.
uuid4
())
args
[
'default_template'
]
=
json
.
dumps
(
default_template
)
args
[
'create_by'
]
=
args
.
get
(
'ifa_id'
)
args
[
'create_time'
]
=
datetime
.
datetime
.
now
()
new_template
=
FundReportManange
(
**
args
)
tamp_diagnose_session
.
add
(
new_template
)
data
=
{
**
default_template
,
**
default_data
}
return
data
...
...
@@ -54,40 +67,28 @@ def add_template(args):
tamp_diagnose_session
.
add
(
fund_report_manange
)
def
update_template
(
args
):
"""更新
默认
模版"""
"""更新模版"""
with
TAMP_SQL
(
tamp_diagnose_app_engine
)
as
tamp_diagnose_app
:
tamp_diagnose_session
=
tamp_diagnose_app
.
session
update_type
=
args
.
get
(
'update_type'
)
type
=
args
.
get
(
'type'
)
res
=
tamp_diagnose_session
.
query
(
FundReportManange
)
.
filter
(
and_
(
FundReportManange
.
ifa_id
==
args
.
get
(
'ifa_id'
),
FundReportManange
.
type
==
type
,
FundReportManange
.
id
==
args
.
get
(
'id'
),
FundReportManange
.
delete_tag
==
0
,
))
if
update_type
==
1
:
if
not
res
:
return
False
if
res
[
0
]
.
default_template
:
# 更新默认模版
if
type
==
1
:
args
[
'name'
]
=
'持仓报告默认模版'
elif
type
==
2
:
args
[
'name'
]
=
'诊断报告默认模版'
if
res
:
res
.
update
({
'default_template'
:
args
.
get
(
'default_template'
),
'update_by'
:
args
.
get
(
'ifa_id'
),
'update_time'
:
datetime
.
datetime
.
now
()
})
else
:
args
[
'create_by'
]
=
args
.
get
(
'ifa_id'
)
args
[
'create_time'
]
=
datetime
.
datetime
.
now
()
new_template
=
FundReportManange
(
**
args
)
tamp_diagnose_session
.
add
(
new_template
)
elif
update_type
==
2
:
res
.
update
({
'default_template'
:
args
.
get
(
'template_data'
),
'update_by'
:
args
.
get
(
'ifa_id'
),
'update_time'
:
datetime
.
datetime
.
now
()
})
else
:
# 更新自定义模版
args
[
'update_by'
]
=
args
.
get
(
'ifa_id'
)
args
[
'update_time'
]
=
datetime
.
datetime
.
now
()
res
.
update
({
'name'
:
args
.
get
(
'name'
),
'custom_template'
:
args
.
get
(
'custom_template'
),
'custom_template'
:
args
.
get
(
'template_data'
),
'update_by'
:
args
.
get
(
'ifa_id'
),
'update_time'
:
datetime
.
datetime
.
now
()
})
...
...
@@ -128,6 +129,33 @@ def get_template_list(args):
conditions
.
append
(
FundReportManange
.
type
==
args
.
get
(
'type'
))
with
TAMP_SQL
(
tamp_diagnose_app_engine
)
as
tamp_diagnose_app
:
tamp_diagnose_session
=
tamp_diagnose_app
.
session
# 新增默认模版
res1
=
tamp_diagnose_session
.
query
(
FundReportManange
)
.
filter
(
and_
(
FundReportManange
.
ifa_id
==
args
.
get
(
'ifa_id'
),
FundReportManange
.
delete_tag
==
0
,
FundReportManange
.
default_template
.
isnot
(
None
)
))
if
not
res1
:
return
False
need_type
=
{
1
,
2
}
exist_type
=
set
()
for
r
in
res1
:
exist_type
.
add
(
r
.
type
)
add_type
=
list
(
need_type
-
exist_type
)
name
,
default_template
=
None
,
None
for
t
in
add_type
:
if
t
==
1
:
name
=
'持仓报告默认模版'
default_template
=
hold_default_template
elif
t
==
2
:
name
=
'诊断报告默认模版'
default_template
=
diagnose_default_template
id
=
str
(
uuid
.
uuid4
())
default_template
=
json
.
dumps
(
default_template
)
create_by
=
args
.
get
(
'ifa_id'
)
create_time
=
datetime
.
datetime
.
now
()
new_template
=
FundReportManange
(
id
=
id
,
ifa_id
=
args
.
get
(
'ifa_id'
),
name
=
name
,
default_template
=
default_template
,
type
=
t
,
create_by
=
create_by
,
create_time
=
create_time
)
tamp_diagnose_session
.
add
(
new_template
)
res
=
tamp_diagnose_session
.
query
(
FundReportManange
)
.
filter
(
and_
(
*
conditions
))
...
...
@@ -143,3 +171,65 @@ def get_template_list(args):
'totalSize'
:
totalSize
}
def
get_make_report_data
(
args
):
"""获取制作模版数据."""
id
=
args
.
get
(
'id'
)
ifa_id
=
args
.
get
(
'ifa_id'
)
customer_id
=
args
.
get
(
'customer_id'
)
default_template
=
''
type
=
1
with
TAMP_SQL
(
tamp_diagnose_app_engine
)
as
tamp_diagnose_app
:
tamp_diagnose_session
=
tamp_diagnose_app
.
session
res
=
tamp_diagnose_session
.
query
(
FundReportManange
)
.
filter
(
and_
(
FundReportManange
.
id
==
id
,
FundReportManange
.
delete_tag
==
0
))
.
first
()
if
not
res
:
return
False
type
=
res
.
type
default_template
=
res
.
default_template
if
not
default_template
:
default_template
=
res
.
custom_template
default_template
=
json
.
loads
(
default_template
)
dt
=
DataIntegrate
(
ifa_id
=
ifa_id
,
customer_id
=
customer_id
,
type
=
type
)
data
=
dt
.
get_template_data
(
default_template
)
return
data
def
make_report
(
args
):
"""制作报告."""
pdf_name
=
str
(
uuid
.
uuid4
())
+
'.pdf'
with
TAMP_SQL
(
tamp_diagnose_app_engine
)
as
tamp_diagnose_app
:
tamp_diagnose_app_session
=
tamp_diagnose_app
.
session
sql
=
"update hold_report set update_time='{}', update_status='{}' where ifa_id='{}' and customer_id='{}'"
.
format
(
datetime
.
datetime
.
now
(),
1
,
ifa_id
,
customer_id
)
tamp_diagnose_app_session
.
execute
(
sql
)
start
=
time
.
time
()
try
:
dt
=
DataIntegrate
(
ifa_id
=
ifa_id
,
customer_id
=
customer_id
,
pdf_name
=
pdf_name
)
dt
.
render_data
()
except
:
pass
print
(
'耗时{}秒'
.
format
(
round
(
time
.
time
()
-
start
,
2
)))
auth
=
oss2
.
Auth
(
config
[
env
][
'oss'
][
'account'
],
config
[
env
][
'oss'
][
'password'
])
# Endpoint以杭州为例,其它Region请按实际情况填写。
bucket
=
oss2
.
Bucket
(
auth
,
'http://oss-cn-shanghai.aliyuncs.com'
,
'tamperdev'
)
# 生成下载文件的签名URL,有效时间为60s。
path
=
bucket
.
sign_url
(
'GET'
,
'productionenv/Start/'
+
pdf_name
,
60
)
with
TAMP_SQL
(
tamp_diagnose_app_engine
)
as
tamp_diagnose_app
:
tamp_diagnose_app_session
=
tamp_diagnose_app
.
session
sql
=
"update hold_report set update_time='{}', update_status='{}', file='{}' where ifa_id='{}' and customer_id='{}'"
.
format
(
datetime
.
datetime
.
now
(),
2
,
pdf_name
,
ifa_id
,
customer_id
)
tamp_diagnose_app_session
.
execute
(
sql
)
\ No newline at end of file
app/templates/v2/monthReportV2.1.html
View file @
bdd373cc
...
...
@@ -2188,7 +2188,7 @@
<div
class=
"financial_scene"
>
<img
src=
{{scene}}
alt=
""
class=
"financial_scene_img"
>
<div
class=
"financial_scene_text"
>
我们挣的是⻆度和变化的钱而不是纠正市场错误的钱,市场永远是正确的,关键是在其正确被反复证明后的逆向而行,一定是避开它的正确被展开的过程。
{{financial_text}}
</div>
<div
class=
"financial_scene_author"
>
...
...
app/utils/jinjia2html_v2.py
View file @
bdd373cc
...
...
@@ -222,7 +222,7 @@ class DataIntegrate:
cur_group_portfolio_result
[
"group_hoding_info"
]
=
group_result
[
"group_hoding_info"
]
cur_group_portfolio_result
[
"group_hoding_info_total"
]
=
group_result
[
"group_hoding_info_total"
]
def
get_template_data
(
self
):
def
get_template_data
(
self
,
default_template
=
None
):
""""""
if
self
.
type
==
1
:
# 持仓报告数据
...
...
@@ -254,8 +254,10 @@ class DataIntegrate:
'all_folio_result'
:
self
.
all_folio_result
,
}
# self.data = {**hold_default_template, **data}
self
.
data
=
data
if
default_template
:
self
.
data
=
{
**
default_template
,
**
data
}
else
:
self
.
data
=
{
**
hold_default_template
,
**
data
}
elif
self
.
type
==
2
:
# 诊断报告数据
data
=
{
...
...
@@ -285,9 +287,10 @@ class DataIntegrate:
# 组合数据
'all_folio_result'
:
self
.
all_folio_result
,
}
# self.data = {**diagnose_default_template, **data}
self
.
data
=
data
print
(
data
)
if
default_template
:
self
.
data
=
{
**
default_template
,
**
data
}
else
:
self
.
data
=
{
**
hold_default_template
,
**
data
}
return
self
.
data
def
render_data
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment