Commit 6e76090d48771cfb01a28e464240e812fe7abe23
1 parent
bbe02223
Exists in
master
função de busca e exclusão de órgãos
Showing
2 changed files
with
17 additions
and
1 deletions
Show diff stats
development.ini
@@ -47,4 +47,4 @@ formatter = generic | @@ -47,4 +47,4 @@ formatter = generic | ||
47 | format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s | 47 | format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s |
48 | 48 | ||
49 | [lbgenerator] | 49 | [lbgenerator] |
50 | -rest_url = http://localhost/api | ||
51 | \ No newline at end of file | 50 | \ No newline at end of file |
51 | +rest_url = http://api.brlight.net/api |
wscacicneo/model/orgao.py
@@ -190,3 +190,19 @@ class Orgao(orgao_base.metaclass): | @@ -190,3 +190,19 @@ class Orgao(orgao_base.metaclass): | ||
190 | return None | 190 | return None |
191 | 191 | ||
192 | return result | 192 | return result |
193 | + | ||
194 | + def search_orgao(self, nm_orgao): | ||
195 | + """ | ||
196 | + Busca registro completo do órgao pelo nome | ||
197 | + """ | ||
198 | + result = self.documentrest.get_collection(search_obj=Search(literal="document->>'"+nm_orgao+"' = 'Ministério da fazenda '")) | ||
199 | + | ||
200 | + return results | ||
201 | + | ||
202 | + def delete_orgao(self, id): | ||
203 | + """ | ||
204 | + Deleta o Órgao apartir do ID | ||
205 | + """ | ||
206 | + resulst = self.documentrest.delete(id) | ||
207 | + | ||
208 | + return results |