__init__(self,
dbset,
field,
label=None,
filterby=None,
filter_opts=None,
not_filterby=None,
not_filter_opts=None,
realms=None,
updateable=False,
instance_types=None,
error_message="invalid value!",
orderby=None,
groupby=None,
left=None,
multiple=False,
zero="",
sort=True,
_and=None)
(Constructor)
| source code
|
Validator for foreign keys.
- Parameters:
dbset - a Set of records like db(query), or db itself
field - the field in the referenced table
label - lookup method for the label corresponding a value, alternatively
a string template to be filled with values from the record
filterby - a field in the referenced table to filter by
filter_opts - values for the filterby field which indicate records to include
not_filterby - a field in the referenced table to filter by
not_filter_opts - values for not_filterby field which indicate records to exclude
realms - only include records belonging to the listed realms (if None, all
readable records will be included)
updateable - only include records in the referenced table which can be updated
by the user (if False, all readable records will be included)
instance_types - if the referenced table is a super-entity, then only include
these instance types (this parameter is required for super entity
lookups!)
error_message - the error message to return for failed validation
orderby - orderby for the options
groupby - groupby for the options
left - additional left joins required for the options lookup
(super-entity instance left joins will be included automatically)
multiple - allow multiple values (for list:reference types)
zero - add this as label for the None-option (allow selection of
"None")
sort - sort options alphabetically by their label
_and - internal use
|