source: MILK/trunk/milk_server/milk_server/models/form.py @ 4676

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/MILK/trunk/milk_server/milk_server/models/form.py@4676
Revision 4676, 1013 bytes checked in by cbyrom, 11 years ago (diff)

New validation schema for granulite input data.

Line 
1from formencode import Schema, validators, Invalid
2import logging
3
4class AtomFormSchema(Schema):
5    def __init__(self):
6        logging.debug("Setting up AtomFormSchema")
7       
8    filter_extra_fields = True
9    allow_extra_fields = True
10    #subtype = validators.UnicodeString(not_empty=True)#URL(not_empty=True, add_http=True, check_exists=False)
11    title = validators.UnicodeString(not_empty=True)
12
13class CreateAtomFormSchema(Schema):
14    def __init__(self):
15        logging.debug("Setting up CreateAtomFormSchema")
16       
17    filter_extra_fields = True
18    allow_extra_fields = True
19    author = validators.UnicodeString(not_empty=True)
20    title = validators.UnicodeString(not_empty=True)
21    providerID = validators.UnicodeString(not_empty=True)
22    atomTypeID = validators.UnicodeString(not_empty=True)
23
24class LoadGranuliteFormSchema(Schema):
25    filter_extra_fields = True
26    allow_extra_fields = True
27    datasetID = validators.UnicodeString()
28    timeAxis = validators.UnicodeString()
29   
30   
Note: See TracBrowser for help on using the repository browser.