d417d88d1e
validator
14 lines
876 B
Python
14 lines
876 B
Python
# -*- coding: utf-8 -*-
|
|
from django.core.validators import RegexValidator
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
|
|
DAVNumberValidator = RegexValidator(r'^'
|
|
r'([0-9]{3}/[0-9]{2}/)?' # Optional: <Sektionsnummer 3-stellig>/<Ortsgruppennummer 2-stellig>/
|
|
r'[0-9]{1,6}' # <Mitgliedsnummer 1- bis 6-stellig>
|
|
r'([*x ][0-9]{4})?' # Optional: *<Kategorienummer 4-stellig>
|
|
r'([*x ][0-9]{4}[*x ][0-9]{4})?' # Optional: *<Jahreszahl DAV-Eintritt>*<Jahreszahl Sektionseintritt>
|
|
r'([*x ][0-9]{8})?' # Optional: *<Geburtsdatum YYYYMMDD>
|
|
r'$',
|
|
_('Ungültiges Format.'))
|