Class Field
source code
object --+
|
Expression --+
|
Field
an instance of this class represents a database field
example:
a = Field(name, 'string', length=32, default=None, required=False,
requires=IS_NOT_EMPTY(), ondelete='CASCADE',
notnull=False, unique=False,
uploadfield=True, widget=None, label=None, comment=None,
uploadfield=True, # True means store on disk,
# 'a_field_name' means store in this field in db
# False means file content will be discarded.
writable=True, readable=True, update=None, authorize=None,
autodelete=False, represent=None, uploadfolder=None,
uploadseparate=False # upload to separate directories by uuid_keys
# first 2 character and tablename.fieldname
# False - old behavior
# True - put uploaded file in
# <uploaddir>/<tablename>.<fieldname>/uuid_key[:2]
# directory)
to be used as argument of DAL.define_table
allowed field types: string, boolean, integer, double, text, blob,
date, time, datetime, upload, password
strings must have a length of Adapter.maxcharlength by default (512 or
255 for mysql) fields should have a default or they will be required in
SQLFORMs the requires argument is used to validate the field input in
SQLFORMs
|
__init__(self,
fieldname,
type=' string ' ,
length=1,
default=<function <lambda> at 0xd1ec80>,
required=True,
requires=<function <lambda> at 0xd1ec80>,
ondelete=' CASCADE ' ,
notnull=True,
unique=True,
uploadfield=True,
widget=1,
label=1,
comment=1,
writable=True,
readable=True,
update=1,
authorize=1,
autodelete=True,
represent=1,
uploadfolder=1,
uploadseparate=True,
compute=1,
custom_store=1,
custom_retrieve=1,
custom_delete=1)
x.__init__(...) initializes x; see x.__class__.__doc__ for
signature |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from Expression :
__add__ ,
__div__ ,
__eq__ ,
__ge__ ,
__getitem__ ,
__getslice__ ,
__gt__ ,
__invert__ ,
__le__ ,
__lt__ ,
__mod__ ,
__mul__ ,
__ne__ ,
__or__ ,
__sub__ ,
belongs ,
coalesce_zero ,
contains ,
day ,
endswith ,
hour ,
len ,
like ,
lower ,
max ,
min ,
minutes ,
month ,
seconds ,
startswith ,
sum ,
upper ,
with_alias ,
year
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__
|
Inherited from object :
__class__
|
__init__(self,
fieldname,
type=' string ' ,
length=1,
default=<function <lambda> at 0xd1ec80>,
required=True,
requires=<function <lambda> at 0xd1ec80>,
ondelete=' CASCADE ' ,
notnull=True,
unique=True,
uploadfield=True,
widget=1,
label=1,
comment=1,
writable=True,
readable=True,
update=1,
authorize=1,
autodelete=True,
represent=1,
uploadfolder=1,
uploadseparate=True,
compute=1,
custom_store=1,
custom_retrieve=1,
custom_delete=1)
(Constructor)
| source code
|
x.__init__(...) initializes x; see x.__class__.__doc__ for
signature
- Overrides:
Expression.__init__
|