Added first files for admin and login/signup in admin
This commit is contained in:
parent
e0ed00af8c
commit
d9b62719d7
139 changed files with 18408 additions and 4 deletions
16
paramecio2/libraries/db/extrafields/usernamefield.py
Normal file
16
paramecio2/libraries/db/extrafields/usernamefield.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
from paramecio2.libraries.db.corefields import PhangoField
|
||||
from paramecio2.libraries.db.coreforms import PasswordForm
|
||||
from hmac import compare_digest as compare_hash
|
||||
import crypt
|
||||
import re
|
||||
|
||||
class UserNameField(PhangoField):
|
||||
|
||||
def check(self, value):
|
||||
|
||||
if not re.match("^[A-Za-z0-9_-]+$", value):
|
||||
self.txt_error='Error: use only letters, numbers, underscores and dashes for this field'
|
||||
self.error=1
|
||||
value=''
|
||||
|
||||
return value
|
||||
Loading…
Add table
Add a link
Reference in a new issue