Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
knowledge_graph
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sun Long
knowledge_graph
Commits
1e95e037
Commit
1e95e037
authored
Apr 25, 2022
by
lyh3024
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into 'master'
fix See merge request lyh3024/knowledge_graph!5
parents
a3323e74
7ec8ca56
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
views.py
block/views.py
+5
-3
No files found.
block/views.py
View file @
1e95e037
...
...
@@ -11,6 +11,7 @@ def get_account(account, from_time, end_time):
from_time
=
tools
.
from_str_to_time
(
from_time
)
end_time
=
tools
.
from_str_to_time
(
end_time
)
addresses
=
[]
if
account
:
if
from_time
:
param
=
{
"account"
:
account
,
'from_time'
:
from_time
.
timestamp
(),
"end_time"
:
end_time
.
timestamp
()}
...
...
@@ -20,7 +21,8 @@ def get_account(account, from_time, end_time):
addresses
=
[
item
[
0
]
for
item
in
items
]
else
:
node
=
Account
.
nodes
.
get_or_none
(
address
=
account
)
addresses
=
[
node
.
address
]
if
node
:
addresses
=
[
node
.
address
]
else
:
if
from_time
:
param
=
{
'from_time'
:
from_time
.
timestamp
(),
"end_time"
:
end_time
.
timestamp
()}
...
...
@@ -132,10 +134,10 @@ def get_block_list(request):
m_address
,
p
,
b_hash
=
item
m
=
Miner
.
nodes
.
get_or_none
(
address
=
m_address
)
b
=
Block
.
nodes
.
get_or_none
(
hash
=
b_hash
)
if
m
.
id
not
in
node_ids
:
if
m
and
m
.
id
not
in
node_ids
:
node_ids
.
append
(
m
.
id
)
resp_nodes
.
append
(
gen_node_json
(
m
))
if
p
.
id
not
in
rel_ids
:
if
p
and
p
.
id
not
in
rel_ids
:
resp_relations
.
append
({
"id"
:
p
.
id
,
"source"
:
m
.
id
,
"target"
:
b
.
id
,
"label"
:
"打包"
})
rel_ids
.
append
(
p
.
id
)
...
...
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