2006-10-29 03:02:26 +08:00
|
|
|
"""
|
|
|
|
Django validation and HTML form handling.
|
|
|
|
|
|
|
|
TODO:
|
|
|
|
Default value for field
|
|
|
|
Field labels
|
|
|
|
Nestable Forms
|
|
|
|
FatalValidationError -- short-circuits all other validators on a form
|
|
|
|
ValidationWarning
|
|
|
|
"This form field requires foo.js" and form.js_includes()
|
|
|
|
"""
|
|
|
|
|
2006-11-05 04:49:59 +08:00
|
|
|
from util import ValidationError
|
2006-10-29 04:34:37 +08:00
|
|
|
from widgets import *
|
|
|
|
from fields import *
|
|
|
|
from forms import Form
|
2006-10-29 03:02:26 +08:00
|
|
|
|
|
|
|
##########################
|
|
|
|
# DATABASE API SHORTCUTS #
|
|
|
|
##########################
|
|
|
|
|
|
|
|
def form_for_model(model):
|
|
|
|
"Returns a Form instance for the given Django model class."
|
|
|
|
raise NotImplementedError
|
|
|
|
|
|
|
|
def form_for_fields(field_list):
|
|
|
|
"Returns a Form instance for the given list of Django database field instances."
|
|
|
|
raise NotImplementedError
|