mirror of https://github.com/interlegis/sigi.git
Sesóstris Vieira
1 year ago
218 changed files with 1611 additions and 775 deletions
@ -1,8 +1,17 @@ |
|||||
from sigi.apps.servicos.models import TipoServico |
from sigi.apps.servicos.models import TipoServico |
||||
|
|
||||
pm = TipoServico.objects.first() |
pm = TipoServico.objects.first() |
||||
res = sorted([(p.casa_legislativa.municipio.uf, p.casa_legislativa.municipio.nome, p.url) for p in pm.servico_set.all()]) |
res = sorted( |
||||
|
[ |
||||
|
( |
||||
|
p.casa_legislativa.municipio.uf, |
||||
|
p.casa_legislativa.municipio.nome, |
||||
|
p.url, |
||||
|
) |
||||
|
for p in pm.servico_set.all() |
||||
|
] |
||||
|
) |
||||
|
|
||||
with open('/tmp/pm.csv', 'w+') as f: |
with open("/tmp/pm.csv", "w+") as f: |
||||
for uf, cid, url in res: |
for uf, cid, url in res: |
||||
f.write(('%s,%s,%s' % (uf.nome, cid, url) + '\n').encode('utf-8')) |
f.write(("%s,%s,%s" % (uf.nome, cid, url) + "\n").encode("utf-8")) |
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue