分类: LINUX
2011-12-27 10:24:18
SQLObject类的列类型 | |
SQLObject 的列 | 描述 |
BLOBCol | Blob of binary datajpeg's, word files, etc. (Works with MySql, Postgres, and SQLlite only) 二进制的blog类型,用于存放jpeg,doc等类型(在MySql,Postgres和SQLlite数据库上有效) |
BoolCol | Stores true/false data, works (differently) on all back ends 存放布尔型数据(在所有DB上有效) |
CurrencyCol | Equivalent to DecimalCol(size=10, precision=2) 相当于DecimalCol(size=10,precision=2) |
DateCol | Stores date returned as datetime 用于存放日期,返回一个datetime, |
DateTimeCol | Stores date and time returned as datetime 存放日期和时间,返回一个datetime |
DecimalCol | Stores a decimal (size=(Number of digits), precision=(after the decimal) 存放十进制数据,size指定位数,precision指定精度(小数点后有几位) |
FloatCol | Stores a floating-point number 存放浮点数据 |
PickleCol | Can store any Python object (It is an extension of BLOBCol, which uses the pickle module from the Python standard library to store serialized objects.) 可以存放任何python的对象(它是一个BLOBCol的扩展,用了Python的标准库pickle来完成对象的序列化) |
StringCol | Stores a string (If length is defined, that's the length; if not, a TEXT col is used.) 存放字符串(如果长度有定义就用这个长度,如果没有定义就用一个TEXTCol) |
UnicodeCol | Special string column that encodes in UTF-8 by default UTF8编码的字符串 |
Model Classes SQLObject Column Parameters SQLObject 的列属性 | |
dbName | Name of Column in database (If none is specified, Pythonic name is converted from MixedCase to underscore_separated; for example, UserName becomes user_name.) 数据库中存放的列名(如果没有定义,采用小写的pythonic风格的值作为默认值,比如,UserName就是user_name) |
default | Defines the default value for the column (If not set, the column is required.) 定义列的默认值(如果没有设置就用这个列的值代替) |
alternateID | If true, 1) makes column value unique, 2) creates a "byUsername like method" to your class 如果为true: 1) 设置这个列值为unique, 2) 给你的类新建一个类似于”byUsername”的方法 |
unique | If true, makes column value unique 如果为真,是该列的值惟一 |
notNone | If true, null not allowed for the column 如果为真,则不允许该列为空. |