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
ea5031cc
Commit
ea5031cc
authored
Apr 25, 2022
by
lyh3024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
Change-Id: Ia8932217198e97e7170f2005ab8aa56eab88bc9b
parent
cab982f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
views.py
block/views.py
+3
-3
settings.py
knowledge_graph/settings.py
+1
-1
tests.py
route/tests.py
+3
-3
No files found.
block/views.py
View file @
ea5031cc
...
...
@@ -19,7 +19,7 @@ def get_account(account, from_time, end_time):
items
=
db
.
cypher_query
(
query
,
param
)[
0
]
addresses
=
[
item
[
0
]
for
item
in
items
]
else
:
node
=
Account
.
nodes
.
get
(
address
=
account
)
node
=
Account
.
nodes
.
get
_or_none
(
address
=
account
)
addresses
=
[
node
.
address
]
else
:
if
from_time
:
...
...
@@ -130,8 +130,8 @@ def get_block_list(request):
for
item
in
items
:
m_address
,
p
,
b_hash
=
item
m
=
Miner
.
nodes
.
get
(
address
=
m_address
)
b
=
Block
.
nodes
.
get
(
hash
=
b_hash
)
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
:
node_ids
.
append
(
m
.
id
)
resp_nodes
.
append
(
gen_node_json
(
m
))
...
...
knowledge_graph/settings.py
View file @
ea5031cc
...
...
@@ -48,7 +48,7 @@ INSTALLED_APPS = [
MIDDLEWARE
=
[
'django.middleware.security.SecurityMiddleware'
,
'django.contrib.sessions.middleware.SessionMiddleware'
,
'corsheaders.middleware.CorsMiddleware'
'corsheaders.middleware.CorsMiddleware'
,
'django.middleware.common.CommonMiddleware'
,
'django.middleware.csrf.CsrfViewMiddleware'
,
'django.contrib.auth.middleware.AuthenticationMiddleware'
,
...
...
route/tests.py
View file @
ea5031cc
...
...
@@ -7,9 +7,9 @@ db.set_connection('bolt://neo4j:lyh0214@localhost:7687')
def
test
(
i
):
t1
=
datetime
(
year
=
2022
,
month
=
1
,
day
=
1
)
ip1
=
'127.0.0'
+
str
(
i
)
ip2
=
'0.0.0'
+
str
(
i
)
ip3
=
'255.255.255'
+
str
(
i
)
ip1
=
'127.0.0
.
'
+
str
(
i
)
ip2
=
'0.0.0
.
'
+
str
(
i
)
ip3
=
'255.255.255
.
'
+
str
(
i
)
n1
=
FirstIp
(
ip
=
ip1
,
country
=
'中国'
,
province
=
'四川'
,
city
=
'成都'
,
isp
=
'电信'
,
start_ip
=
ip1
,
root_ip
=
ip3
)
n2
=
RouteIp
(
ip
=
ip2
,
country
=
'中国'
,
province
=
'四川'
,
city
=
'成都'
,
isp
=
'电信'
,
start_ip
=
ip1
,
root_ip
=
ip3
)
n3
=
EndIp
(
ip
=
ip3
,
country
=
'中国'
,
province
=
'四川'
,
city
=
'成都'
,
isp
=
'电信'
,
start_ip
=
ip1
,
root_ip
=
ip3
)
...
...
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