sqlobject.main module¶
SQLObject¶
author: | Ian Bicking <ianb@colorstudy.com> |
---|
SQLObject is a object-relational mapper. See SQLObject.html or SQLObject.rst for more.
With the help by Oleg Broytman and many other contributors. See Authors.rst.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-
class
sqlobject.main.
SQLObject
(**kw)[source]¶ Bases:
object
-
SelectResultsClass
¶ alias of
sqlobject.sresults.SelectResults
-
childName
= None¶
-
classmethod
createTable
(ifNotExists=False, createJoinTables=True, createIndexes=True, applyConstraints=True, connection=None)[source]¶
-
classmethod
select
(clause=None, clauseTables=None, orderBy=<class sqlobject.sqlbuilder.NoDefault>, limit=None, lazyColumns=False, reversed=False, distinct=False, connection=None, join=None, forUpdate=False)[source]¶
-
class
sqlmeta
(instance)¶ Bases:
object
This object is the object we use to keep track of all sorts of information. Subclasses are made for each SQLObject subclass (dynamically if necessary), and instances are created to go alongside every SQLObject instance.
-
classmethod
addColumn
(columnDef, changeSchema=False, connection=None)¶
-
classmethod
addColumnsFromDatabase
(connection=None)¶
-
classmethod
addIndex
(indexDef)¶
-
classmethod
addJoin
(joinDef)¶
-
asDict
()¶ Return the object as a dictionary of columns to values.
-
cacheValues
= True¶
-
childClasses
= {}¶
-
childName
= None¶
-
dbEncoding
= None¶
-
defaultOrder
= None¶
-
classmethod
delColumn
(column, changeSchema=False, connection=None)¶
-
classmethod
delJoin
(joinDef)¶
-
dirty
= False¶
-
classmethod
expireAll
(connection=None)¶ Expire all instances of this class.
-
expired
= False¶
-
fromDatabase
= False¶
-
classmethod
getColumns
()¶
-
idName
= None¶
-
idSequence
= None¶
-
idSize
= None¶
-
idType
¶ alias of
__builtin__.int
-
indexes
= []¶
-
joinDefinitions
= []¶
-
joins
= []¶
-
lazyUpdate
= False¶
-
parentClass
= None¶
-
registry
= None¶
-
classmethod
send
(signal, *args, **kw)¶
-
classmethod
setClass
(soClass)¶
-
style
= None¶
-
table
= None¶
-
classmethod
-
-
sqlobject.main.
sqlhub
¶ This object serves as a hub for connections, so that you can pass in a ConnectionHub to a SQLObject subclass as though it was a connection, but actually bind a real database connection later. You can also bind connections on a per-thread basis.
You must hang onto the original ConnectionHub instance, as you cannot retrieve it again from the class or instance.
To use the hub, do something like:
hub = ConnectionHub() class MyClass(SQLObject): _connection = hub hub.threadConnection = connectionFromURI('...')
-
class
sqlobject.main.
sqlmeta
(instance)[source]¶ Bases:
object
This object is the object we use to keep track of all sorts of information. Subclasses are made for each SQLObject subclass (dynamically if necessary), and instances are created to go alongside every SQLObject instance.
-
cacheValues
= True¶
-
childClasses
= {}¶
-
childName
= None¶
-
dbEncoding
= None¶
-
defaultOrder
= None¶
-
dirty
= False¶
-
expired
= False¶
-
fromDatabase
= False¶
-
idName
= None¶
-
idSequence
= None¶
-
idSize
= None¶
-
idType
¶ alias of
__builtin__.int
-
indexes
= []¶
-
joinDefinitions
= []¶
-
joins
= []¶
-
lazyUpdate
= False¶
-
parentClass
= None¶
-
registry
= None¶
-
style
= None¶
-
table
= None¶
-