Skip to content

Instantly share code, notes, and snippets.

View jhurtadojerves's full-sized avatar
🏠
Working from home

Julio Hurtado jhurtadojerves

🏠
Working from home
  • Macas, Ecuador
  • 20:27 (UTC -05:00)
View GitHub Profile
@jhurtadojerves
jhurtadojerves / Valida Cedula
Created June 1, 2016 17:40 — forked from codeadict/Valida Cedula
Validar cedula Ecuatoriana en un form de DJANGO
def clean_cedula(self):
"""
Valída que sea Correcta la Cédula
"""
ced = self.cleaned_data['cedula']
msg = "La Cédula introducida no es válida"
valores = [ int(ced[x]) * (2 - x % 2) for x in range(9) ]
suma = sum(map(lambda x: x > 9 and x - 9 or x, valores))
veri = 10 - (suma - (10 * (suma / 10)))
if int(ced[9]) == int(str(veri)[-1:]):
// Tacit, Wrist mounted tactile feedback for the blind.
// By Steve Hoefer at Grathio Labs (http://grathio.com)
// Version 12.02.04
//
// Copyright (c) 2012 Steve Hoefer
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
// associated documentation files (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions: