Docs for Field

[ Python Tutorial ] [ Python Libraries ] [ web2py epydoc ]

Description


<type 'type'> extends (<class 'gluon.sql.Expression'>,)





























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)

to be used as argument of SQLDB.define_table

allowed field types:
string, boolean, integer, double, text, blob,
date, time, datetime, upload, password

strings must have a length or 512 by default.
fields should have a default or they will be required in SQLFORMs
the requires argument is used to validate the field input in SQLFORMs



Attributes


Field.__add__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__class__ <type 'type'> extends (<type 'object'>,) belongs to class <type 'type'>
type(object) -> the object's type type(name, bases, dict) -> a new type

Field.__delattr__ <type 'wrapper_descriptor'> belongs to class <type 'wrapper_descriptor'>
x.__delattr__('name') <==> del x.name

Field.__dict__ <type 'dictproxy'> belongs to class <type 'dictproxy'>

Field.__div__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__doc__ <type 'str'> belongs to class <type 'str'>
str(object) -> string Return a nice string representation of the object. If the argument is a string, the return value is the same object.

Field.__eq__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__ge__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__getattribute__ <type 'wrapper_descriptor'> belongs to class <type 'wrapper_descriptor'>
x.__getattribute__('name') <==> x.name

Field.__getitem__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__getslice__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__gt__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__hash__ <type 'wrapper_descriptor'> belongs to class <type 'wrapper_descriptor'>
x.__hash__() <==> hash(x)

Field.__init__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__invert__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__le__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__lt__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__module__ <type 'str'> belongs to class <type 'str'>
str(object) -> string Return a nice string representation of the object. If the argument is a string, the return value is the same object.

Field.__mul__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__ne__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__new__ <type 'builtin_function_or_method'> belongs to class <type 'builtin_function_or_method'>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Field.__nonzero__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__or__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__reduce__ <type 'method_descriptor'> belongs to class <type 'method_descriptor'>
helper for pickle

Field.__reduce_ex__ <type 'method_descriptor'> belongs to class <type 'method_descriptor'>
helper for pickle

Field.__repr__ <type 'wrapper_descriptor'> belongs to class <type 'wrapper_descriptor'>
x.__repr__() <==> repr(x)

Field.__setattr__ <type 'wrapper_descriptor'> belongs to class <type 'wrapper_descriptor'>
x.__setattr__('name', value) <==> x.name = value

Field.__slotnames__ <type 'list'> belongs to class <type 'list'>
list() -> new list list(sequence) -> new list initialized from sequence's items

Field.__str__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__sub__ <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.__weakref__ <type 'getset_descriptor'> belongs to class <type 'getset_descriptor'>
list of weak references to the object (if defined)

Field.belongs <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.count <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.day <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.formatter <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.hour <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.len <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.like <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.lower <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.max <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.min <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.minutes <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.month <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.retrieve <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.seconds <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.store <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.sum <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.upper <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.validate <type 'instancemethod'> belongs to class <type 'instancemethod'>

Field.year <type 'instancemethod'> belongs to class <type 'instancemethod'>