Add a sample validation function. The parse_date will parse and cleanup dates entered by users. Issue #104.
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
"""Configuration options for the metadata app"""
|
||||
|
||||
from dateutil.parser import parse
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.utils.timezone import now
|
||||
|
||||
from smart_settings.api import register_settings
|
||||
|
||||
|
||||
default_available_functions = {
|
||||
'current_date': now().date,
|
||||
}
|
||||
@@ -15,6 +16,7 @@ default_available_models = {
|
||||
}
|
||||
|
||||
default_available_validators = {
|
||||
'parse_date': lambda input: parse(input).isoformat()
|
||||
}
|
||||
|
||||
register_settings(
|
||||
|
||||
@@ -23,6 +23,7 @@ pdfminer==20110227
|
||||
psutil==2.1.3
|
||||
pycountry==1.8
|
||||
pytz==2014.4
|
||||
python-dateutil==2.4.0
|
||||
python-gnupg==0.3.6
|
||||
python-hkp==0.1.3
|
||||
python-magic==0.4.6
|
||||
|
||||
Reference in New Issue
Block a user