# sqlobject.col module

Col – SQLObject columns

Note that each column object is named BlahBlahCol, and these are used in class definitions. But there’s also a corresponding SOBlahBlahCol object, which is used in SQLObject classes.

An explanation: when a SQLObject subclass is created, the metaclass looks through your class definition for any subclasses of Col. It collects them together, and indexes them to do all the database stuff you like, like the magic attributes and whatnot. It then asks the Col object to create an SOCol object (usually a subclass, actually). The SOCol object contains all the interesting logic, as well as a record of the attribute name you used and the class it is bound to (set by the metaclass).

So, in summary: Col objects are what you define, but SOCol objects are what gets used.

`sqlobject.col.``use_microseconds`(use=True)

class `sqlobject.col.``SOCol`(name, soClass, creationOrder, dbName=None, default=<class 'sqlobject.sqlbuilder.NoDefault'>, defaultSQL=None, foreignKey=None, alternateID=False, alternateMethodName=None, constraints=None, notNull=<class 'sqlobject.sqlbuilder.NoDefault'>, notNone=<class 'sqlobject.sqlbuilder.NoDefault'>, unique=<class 'sqlobject.sqlbuilder.NoDefault'>, sqlType=None, columnDef=None, validator=None, validator2=None, immutable=False, cascade=None, lazy=False, noCache=False, forceDBName=False, title=None, tags=[], origName=None, dbEncoding=None, extra_vars=None)

  Bases: `object`

  `autoConstraints`()
  `createSQL`()
  `createValidators`()

    Create a list of validators for the column.

  `default`
  `firebirdCreateSQL`()
  `getDbEncoding`(state, default='utf-8')
  `joinName`
  `maxdbCreateSQL`()
  `mssqlCreateSQL`(connection=None)
  `mysqlCreateSQL`(connection=None)
  `postgresCreateSQL`()
  `sqliteCreateSQL`()
  `sybaseCreateSQL`()
  `validator`

class `sqlobject.col.``Col`(name=None, **kw)

  Bases: `object`

  `baseClass`

    alias of `SOCol`

  `name`
  `withClass`(soClass)

class `sqlobject.col.``SOStringLikeCol`(**kw)

  Bases: `sqlobject.col.SOCol`

  A common ancestor for SOStringCol and SOUnicodeCol

  `autoConstraints`()

class `sqlobject.col.``SOStringCol`(**kw)

  Bases: `sqlobject.col.SOStringLikeCol`

  `createValidators`(dataType=None)

    Create a list of validators for the column.

class `sqlobject.col.``StringCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOStringCol`

class `sqlobject.col.``SOUnicodeCol`(**kw)

  Bases: `sqlobject.col.SOStringLikeCol`

  `createValidators`()

    Create a list of validators for the column.

class `sqlobject.col.``UnicodeCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOUnicodeCol`

class `sqlobject.col.``SOIntCol`(**kw)

  Bases: `sqlobject.col.SOCol`

  `addSQLAttrs`(str)
  `autoConstraints`()
  `createValidators`()

    Create a list of validators for the column.

class `sqlobject.col.``IntCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOIntCol`

class `sqlobject.col.``SOTinyIntCol`(**kw)

  Bases: `sqlobject.col.SOIntCol`

class `sqlobject.col.``TinyIntCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOTinyIntCol`

class `sqlobject.col.``SOSmallIntCol`(**kw)

  Bases: `sqlobject.col.SOIntCol`

class `sqlobject.col.``SmallIntCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOSmallIntCol`

class `sqlobject.col.``SOMediumIntCol`(**kw)

  Bases: `sqlobject.col.SOIntCol`

class `sqlobject.col.``MediumIntCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOMediumIntCol`

class `sqlobject.col.``SOBigIntCol`(**kw)

  Bases: `sqlobject.col.SOIntCol`

class `sqlobject.col.``BigIntCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOBigIntCol`

class `sqlobject.col.``SOBoolCol`(name, soClass, creationOrder, dbName=None, default=<class 'sqlobject.sqlbuilder.NoDefault'>, defaultSQL=None, foreignKey=None, alternateID=False, alternateMethodName=None, constraints=None, notNull=<class 'sqlobject.sqlbuilder.NoDefault'>, notNone=<class 'sqlobject.sqlbuilder.NoDefault'>, unique=<class 'sqlobject.sqlbuilder.NoDefault'>, sqlType=None, columnDef=None, validator=None, validator2=None, immutable=False, cascade=None, lazy=False, noCache=False, forceDBName=False, title=None, tags=[], origName=None, dbEncoding=None, extra_vars=None)

  Bases: `sqlobject.col.SOCol`

  `autoConstraints`()
  `createValidators`()

    Create a list of validators for the column.

class `sqlobject.col.``BoolCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOBoolCol`

class `sqlobject.col.``SOFloatCol`(name, soClass, creationOrder, dbName=None, default=<class 'sqlobject.sqlbuilder.NoDefault'>, defaultSQL=None, foreignKey=None, alternateID=False, alternateMethodName=None, constraints=None, notNull=<class 'sqlobject.sqlbuilder.NoDefault'>, notNone=<class 'sqlobject.sqlbuilder.NoDefault'>, unique=<class 'sqlobject.sqlbuilder.NoDefault'>, sqlType=None, columnDef=None, validator=None, validator2=None, immutable=False, cascade=None, lazy=False, noCache=False, forceDBName=False, title=None, tags=[], origName=None, dbEncoding=None, extra_vars=None)

  Bases: `sqlobject.col.SOCol`

  `autoConstraints`()
  `createValidators`()

    Create a list of validators for the column.

class `sqlobject.col.``FloatCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOFloatCol`

class `sqlobject.col.``SOKeyCol`(**kw)

  Bases: `sqlobject.col.SOCol`

  `key_type` = {<class 'int'>: 'INT', <class 'str'>: 'TEXT'}

class `sqlobject.col.``KeyCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOKeyCol`

class `sqlobject.col.``SOForeignKey`(**kw)

  Bases: `sqlobject.col.SOKeyCol`

  `createValidators`()

    Create a list of validators for the column.

  `maxdbCreateReferenceConstraint`()
  `maxdbCreateSQL`()
  `mssqlCreateReferenceConstraint`()
  `mssqlCreateSQL`(connection=None)
  `mysqlCreateReferenceConstraint`()
  `mysqlCreateSQL`(connection=None)
  `postgresCreateReferenceConstraint`()
  `postgresCreateSQL`()
  `sqliteCreateSQL`()
  `sybaseCreateReferenceConstraint`()
  `sybaseCreateSQL`()

class `sqlobject.col.``ForeignKey`(foreignKey=None, **kw)

  Bases: `sqlobject.col.KeyCol`

  `baseClass`

    alias of `SOForeignKey`

class `sqlobject.col.``SOEnumCol`(**kw)

  Bases: `sqlobject.col.SOCol`

  `autoConstraints`()
  `createValidators`()

    Create a list of validators for the column.

class `sqlobject.col.``EnumCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOEnumCol`

class `sqlobject.col.``SOSetCol`(**kw)

  Bases: `sqlobject.col.SOCol`

  `autoConstraints`()
  `createValidators`()

    Create a list of validators for the column.

class `sqlobject.col.``SetCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOSetCol`

class `sqlobject.col.``SODateTimeCol`(**kw)

  Bases: `sqlobject.col.SOCol`

  `createValidators`()

    Create a list of validators for the column.

  `datetimeFormat` = '%Y-%m-%d %H:%M:%S.%f'

class `sqlobject.col.``DateTimeCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SODateTimeCol`

  static `now`()

class `sqlobject.col.``SODateCol`(**kw)

  Bases: `sqlobject.col.SOCol`

  `createValidators`()

    Create a validator for the column.

    Can be overriden in descendants.

  `dateFormat` = '%Y-%m-%d'

class `sqlobject.col.``DateCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SODateCol`

class `sqlobject.col.``SOTimeCol`(**kw)

  Bases: `sqlobject.col.SOCol`

  `createValidators`()

    Create a list of validators for the column.

  `timeFormat` = '%H:%M:%S.%f'

class `sqlobject.col.``TimeCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOTimeCol`

class `sqlobject.col.``SOTimestampCol`(**kw)

  Bases: `sqlobject.col.SODateTimeCol`

  Necessary to support MySQL’s use of TIMESTAMP versus DATETIME types

class `sqlobject.col.``TimestampCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOTimestampCol`

class `sqlobject.col.``SOTimedeltaCol`(name, soClass, creationOrder, dbName=None, default=<class 'sqlobject.sqlbuilder.NoDefault'>, defaultSQL=None, foreignKey=None, alternateID=False, alternateMethodName=None, constraints=None, notNull=<class 'sqlobject.sqlbuilder.NoDefault'>, notNone=<class 'sqlobject.sqlbuilder.NoDefault'>, unique=<class 'sqlobject.sqlbuilder.NoDefault'>, sqlType=None, columnDef=None, validator=None, validator2=None, immutable=False, cascade=None, lazy=False, noCache=False, forceDBName=False, title=None, tags=[], origName=None, dbEncoding=None, extra_vars=None)

  Bases: `sqlobject.col.SOCol`

  `createValidators`()

    Create a list of validators for the column.

class `sqlobject.col.``TimedeltaCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOTimedeltaCol`

class `sqlobject.col.``SODecimalCol`(**kw)

  Bases: `sqlobject.col.SOCol`

  `createValidators`()

    Create a list of validators for the column.

class `sqlobject.col.``DecimalCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SODecimalCol`

class `sqlobject.col.``SOCurrencyCol`(**kw)

  Bases: `sqlobject.col.SODecimalCol`

class `sqlobject.col.``CurrencyCol`(name=None, **kw)

  Bases: `sqlobject.col.DecimalCol`

  `baseClass`

    alias of `SOCurrencyCol`

class `sqlobject.col.``SODecimalStringCol`(**kw)

  Bases: `sqlobject.col.SOStringCol`

  `createValidators`()

    Create a list of validators for the column.

class `sqlobject.col.``DecimalStringCol`(name=None, **kw)

  Bases: `sqlobject.col.StringCol`

  `baseClass`

    alias of `SODecimalStringCol`

class `sqlobject.col.``SOBLOBCol`(**kw)

  Bases: `sqlobject.col.SOStringCol`

  `createValidators`()

    Create a list of validators for the column.

class `sqlobject.col.``BLOBCol`(name=None, **kw)

  Bases: `sqlobject.col.StringCol`

  `baseClass`

    alias of `SOBLOBCol`

class `sqlobject.col.``SOPickleCol`(**kw)

  Bases: `sqlobject.col.SOBLOBCol`

  `createValidators`()

    Create a list of validators for the column.

class `sqlobject.col.``PickleCol`(name=None, **kw)

  Bases: `sqlobject.col.BLOBCol`

  `baseClass`

    alias of `SOPickleCol`

class `sqlobject.col.``SOUuidCol`(name, soClass, creationOrder, dbName=None, default=<class 'sqlobject.sqlbuilder.NoDefault'>, defaultSQL=None, foreignKey=None, alternateID=False, alternateMethodName=None, constraints=None, notNull=<class 'sqlobject.sqlbuilder.NoDefault'>, notNone=<class 'sqlobject.sqlbuilder.NoDefault'>, unique=<class 'sqlobject.sqlbuilder.NoDefault'>, sqlType=None, columnDef=None, validator=None, validator2=None, immutable=False, cascade=None, lazy=False, noCache=False, forceDBName=False, title=None, tags=[], origName=None, dbEncoding=None, extra_vars=None)

  Bases: `sqlobject.col.SOCol`

  `createValidators`()

    Create a list of validators for the column.

class `sqlobject.col.``UuidCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOUuidCol`

class `sqlobject.col.``SOJsonbCol`(name, soClass, creationOrder, dbName=None, default=<class 'sqlobject.sqlbuilder.NoDefault'>, defaultSQL=None, foreignKey=None, alternateID=False, alternateMethodName=None, constraints=None, notNull=<class 'sqlobject.sqlbuilder.NoDefault'>, notNone=<class 'sqlobject.sqlbuilder.NoDefault'>, unique=<class 'sqlobject.sqlbuilder.NoDefault'>, sqlType=None, columnDef=None, validator=None, validator2=None, immutable=False, cascade=None, lazy=False, noCache=False, forceDBName=False, title=None, tags=[], origName=None, dbEncoding=None, extra_vars=None)

  Bases: `sqlobject.col.SOCol`

  `createValidators`()

    Create a list of validators for the column.

class `sqlobject.col.``JsonbCol`(name=None, **kw)

  Bases: `sqlobject.col.Col`

  `baseClass`

    alias of `SOJsonbCol`

class `sqlobject.col.``SOJSONCol`(**kw)

  Bases: `sqlobject.col.SOStringCol`

  `createValidators`()

    Create a list of validators for the column.

class `sqlobject.col.``JSONCol`(name=None, **kw)

  Bases: `sqlobject.col.StringCol`

  `baseClass`

    alias of `SOJSONCol`