Skip to content

Commit

Permalink
[IMP] clean dict
Browse files Browse the repository at this point in the history
  • Loading branch information
ovnicraft committed Sep 7, 2018
1 parent 0313643 commit a8896fe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion runa/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,15 @@ def is_valid(self):
self.ValidRUC = stdnum.ec.ruc.is_valid(self.RUC)
return self.RUC

def clean_dict(self, cls):
toclean = cls.__dict__
toclean.pop('__metadata__')
toclean.pop('__printer__')
toclean.pop('__keylist__')
return toclean

def prepare(self, response):
self.actividadEconomica = response.actividadEconomica
self.actividadEconomica = self.clean_dict(response.actividadEconomica)
self.codClaseContrib = response.codClaseContrib
self.codEstado = response.codEstado
self.desClaseContrib = response.desClaseContrib
Expand Down

0 comments on commit a8896fe

Please sign in to comment.