mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-01-22 12:34:17 +00:00
py-i2phosts-builder: split queryset
Just for improve readability.
This commit is contained in:
parent
8bdae565a5
commit
a3b8128002
@ -14,8 +14,11 @@ from web.postkey.models import i2phost
|
|||||||
hostsfile = 'hosts.txt'
|
hostsfile = 'hosts.txt'
|
||||||
|
|
||||||
f = open(hostsfile, 'w')
|
f = open(hostsfile, 'w')
|
||||||
# select name and hash for all activated hosts
|
# get activated hosts
|
||||||
l = i2phost.objects.filter(activated=True).values('name', 'b64hash')
|
qs = i2phost.objects.filter(activated=True)
|
||||||
|
# select theirs name and base64 hash
|
||||||
|
l = qs.values('name', 'b64hash')
|
||||||
|
# write final hosts.txt-format file
|
||||||
for entry in l:
|
for entry in l:
|
||||||
f.write(entry['name'] + '=' + entry['b64hash'] + '\n')
|
f.write(entry['name'] + '=' + entry['b64hash'] + '\n')
|
||||||
f.close()
|
f.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user