sqlobject.styles module

class sqlobject.styles.Style(pythonAttrToDBColumn=None, dbColumnToPythonAttr=None, pythonClassToDBTable=None, dbTableToPythonClass=None, idForTable=None, longID=False)[source]

Bases: object

The base Style class, and also the simplest implementation. No translation occurs – column names and attribute names match, as do class names and table names (when using auto class or schema generation).

dbColumnToPythonAttr(col)[source]
dbTableToPythonClass(table)[source]
idForTable(table)[source]
instanceAttrToIDAttr(attr)[source]
instanceIDAttrToAttr(attr)[source]
pythonAttrToDBColumn(attr)[source]
pythonClassToAttr(className)[source]
pythonClassToDBTable(className)[source]
tableReference(table)[source]
class sqlobject.styles.MixedCaseUnderscoreStyle(pythonAttrToDBColumn=None, dbColumnToPythonAttr=None, pythonClassToDBTable=None, dbTableToPythonClass=None, idForTable=None, longID=False)[source]

Bases: sqlobject.styles.Style

This is the default style. Python attributes use mixedCase, while database columns use underscore_separated.

dbColumnToPythonAttr(col)[source]
dbTableToPythonClass(table)[source]
pythonAttrToDBColumn(attr)[source]
pythonClassToDBTable(className)[source]
pythonClassToDBTableReference(className)[source]
tableReference(table)[source]
sqlobject.styles.DefaultStyle

alias of sqlobject.styles.MixedCaseUnderscoreStyle

class sqlobject.styles.MixedCaseStyle(pythonAttrToDBColumn=None, dbColumnToPythonAttr=None, pythonClassToDBTable=None, dbTableToPythonClass=None, idForTable=None, longID=False)[source]

Bases: sqlobject.styles.Style

This style leaves columns as mixed-case, and uses long ID names (like ProductID instead of simply id).

dbColumnToPythonAttr(col)[source]
dbTableToPythonClass(table)[source]
pythonAttrToDBColumn(attr)[source]
tableReference(table)[source]