From a3b81280021bfcbf243e0cc720dc9558d1b77bd2 Mon Sep 17 00:00:00 2001 From: Hidden Z Date: Tue, 26 Oct 2010 17:57:59 +0000 Subject: [PATCH] py-i2phosts-builder: split queryset Just for improve readability. --- py-i2phosts-builder | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/py-i2phosts-builder b/py-i2phosts-builder index 23a0210..64441bf 100755 --- a/py-i2phosts-builder +++ b/py-i2phosts-builder @@ -14,8 +14,11 @@ from web.postkey.models import i2phost hostsfile = 'hosts.txt' f = open(hostsfile, 'w') -# select name and hash for all activated hosts -l = i2phost.objects.filter(activated=True).values('name', 'b64hash') +# get activated hosts +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: f.write(entry['name'] + '=' + entry['b64hash'] + '\n') f.close()