mirror of https://github.com/interlegis/sigi.git
Marcio Mazza
10 years ago
1 changed files with 8 additions and 0 deletions
@ -0,0 +1,8 @@ |
|||||
|
from sigi.apps.servicos.models import TipoServico |
||||
|
|
||||
|
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()]) |
||||
|
|
||||
|
with open('/tmp/pm.csv', 'w+') as f: |
||||
|
for uf, cid, url in res: |
||||
|
f.write(('%s,%s,%s' % (uf.nome, cid, url) + '\n').encode('utf-8')) |
Loading…
Reference in new issue