Created
January 27, 2014 13:40
-
-
Save isouzasoares/8648725 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getCidsLugarCerto(req,k): | |
""" | |
Retorna a lista de cidade por estado | |
""" | |
from mod_ppc.db.ppc_cid_cidade import instancia as ccid | |
from mod_ppc.config import configVars | |
from mod_gen.util.py2json import py2json as _py2json | |
from mod_gen.db.db import close | |
try: | |
if(not __validaReferer__(req)): return 'false' | |
resp = ccid(configVars=configVars, req=req).getLugarCerto( | |
filtro={ | |
'ppc_est_uf':k['uf'] | |
}) | |
resp = _py2json(resp) | |
if(k.get('jsoncallback')): resp = k['jsoncallback']+('(%s)' % resp) | |
return resp | |
finally: | |
close(req) | |
def getCidsMGLugarCerto(req,k): | |
""" | |
Retorna a lista de cidade por estado | |
""" | |
from mod_ppc.db.ppc_cid_cidade_minas import instancia as ccid | |
from mod_ppc.config import configVars | |
from mod_gen.util.py2json import py2json as _py2json | |
from mod_gen.db.db import close | |
try: | |
if(not __validaReferer__(req)): return 'false' | |
resp = ccid(configVars=configVars, req=req).get( | |
filtro={ | |
'regiao':k['regiao'] | |
}) | |
resp = _py2json(resp) | |
if(k.get('jsoncallback')): resp = k['jsoncallback']+('(%s)' % resp) | |
return resp | |
finally: | |
close(req) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment