Commit a3323e74 by lyh3024

Merge branch 'develop' into 'master'

fix

See merge request lyh3024/knowledge_graph!4
parents 67103062 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))
......
......@@ -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',
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment