(self, obj, **kwargs)
| 36 | return self._db.ufs.find_one({'nome': nome}, **kwargs) |
| 37 | |
| 38 | def insert_or_update(self, obj, **kwargs): |
| 39 | |
| 40 | update = {'$set': obj} |
| 41 | empty_fields = set(self._fields) - set(obj) |
| 42 | update['$unset'] = dict((x, 1) for x in empty_fields) |
| 43 | |
| 44 | self._db.ceps.update({'cep': obj['cep']}, update, upsert=True) |
| 45 | |
| 46 | def insert_or_update_uf(self, obj, **kwargs): |
| 47 | update = {'$set': obj} |
no outgoing calls