Fixes
This commit is contained in:
parent
20becdbd27
commit
b2fba8870f
33 changed files with 3958 additions and 38 deletions
18
cromosoma/extrafields/emailfield.py
Normal file
18
cromosoma/extrafields/emailfield.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from paramecio.cromosoma.corefields import CharField
|
||||
import re
|
||||
|
||||
mail_pattern=re.compile("\w[\w\.-]*@\w[\w\.-]+\.\w+")
|
||||
|
||||
class EmailField(CharField):
|
||||
|
||||
def check(self, value):
|
||||
|
||||
self.error=False
|
||||
self.txt_error=''
|
||||
|
||||
if not mail_pattern.match(value):
|
||||
|
||||
self.error=True
|
||||
self.txt_error='No valid format'
|
||||
|
||||
return value
|
||||
Loading…
Add table
Add a link
Reference in a new issue