sqlobject-cvs Mailing List for SQLObject (Page 119)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
(9) |
Apr
(74) |
May
(29) |
Jun
(16) |
Jul
(28) |
Aug
(10) |
Sep
(57) |
Oct
(9) |
Nov
(29) |
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(7) |
Feb
(14) |
Mar
(6) |
Apr
(3) |
May
(12) |
Jun
(34) |
Jul
(9) |
Aug
(29) |
Sep
(22) |
Oct
(2) |
Nov
(15) |
Dec
(52) |
| 2005 |
Jan
(47) |
Feb
(78) |
Mar
(14) |
Apr
(35) |
May
(33) |
Jun
(16) |
Jul
(26) |
Aug
(63) |
Sep
(40) |
Oct
(96) |
Nov
(96) |
Dec
(123) |
| 2006 |
Jan
(159) |
Feb
(144) |
Mar
(64) |
Apr
(31) |
May
(88) |
Jun
(48) |
Jul
(16) |
Aug
(64) |
Sep
(87) |
Oct
(92) |
Nov
(56) |
Dec
(76) |
| 2007 |
Jan
(94) |
Feb
(103) |
Mar
(126) |
Apr
(123) |
May
(85) |
Jun
(11) |
Jul
(130) |
Aug
(47) |
Sep
(65) |
Oct
(70) |
Nov
(12) |
Dec
(11) |
| 2008 |
Jan
(30) |
Feb
(55) |
Mar
(88) |
Apr
(20) |
May
(50) |
Jun
|
Jul
(38) |
Aug
(1) |
Sep
(9) |
Oct
(5) |
Nov
(6) |
Dec
(39) |
| 2009 |
Jan
(8) |
Feb
(16) |
Mar
(3) |
Apr
(33) |
May
(44) |
Jun
(1) |
Jul
(10) |
Aug
(33) |
Sep
(74) |
Oct
(22) |
Nov
|
Dec
(15) |
| 2010 |
Jan
(28) |
Feb
(22) |
Mar
(46) |
Apr
(29) |
May
(1) |
Jun
(1) |
Jul
(27) |
Aug
(8) |
Sep
(5) |
Oct
(33) |
Nov
(24) |
Dec
(41) |
| 2011 |
Jan
(4) |
Feb
(12) |
Mar
(35) |
Apr
(29) |
May
(19) |
Jun
(16) |
Jul
(32) |
Aug
(25) |
Sep
(5) |
Oct
(11) |
Nov
(21) |
Dec
(12) |
| 2012 |
Jan
(3) |
Feb
(4) |
Mar
(20) |
Apr
(4) |
May
(25) |
Jun
(13) |
Jul
|
Aug
|
Sep
(2) |
Oct
(25) |
Nov
(9) |
Dec
(1) |
| 2013 |
Jan
(6) |
Feb
(8) |
Mar
|
Apr
(10) |
May
(31) |
Jun
(7) |
Jul
(18) |
Aug
(33) |
Sep
(4) |
Oct
(16) |
Nov
|
Dec
(27) |
| 2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(11) |
May
(39) |
Jun
(8) |
Jul
(11) |
Aug
(4) |
Sep
|
Oct
(27) |
Nov
|
Dec
(71) |
| 2015 |
Jan
(17) |
Feb
(47) |
Mar
(33) |
Apr
|
May
|
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(8) |
| 2016 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
|
May
(12) |
Jun
(7) |
Jul
(9) |
Aug
(31) |
Sep
(8) |
Oct
(3) |
Nov
(15) |
Dec
(1) |
| 2017 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(8) |
May
(10) |
Jun
(4) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(4) |
Dec
(5) |
| 2018 |
Jan
(2) |
Feb
(8) |
Mar
|
Apr
(4) |
May
|
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
(1) |
Feb
(16) |
Mar
(1) |
Apr
(3) |
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
| 2021 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
(4) |
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
|
| 2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(9) |
| 2025 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(2) |
Dec
(2) |
|
From: <sub...@co...> - 2006-09-26 14:36:20
|
Author: phd
Date: 2006-09-26 08:36:15 -0600 (Tue, 26 Sep 2006)
New Revision: 1953
Modified:
home/phd/SQLObject/paramstyles/sqlobject/col.py
home/phd/SQLObject/paramstyles/sqlobject/dbconnection.py
home/phd/SQLObject/paramstyles/sqlobject/main.py
home/phd/SQLObject/paramstyles/sqlobject/sqlite/sqliteconnection.py
Log:
Merged patches from the revisions 1947:1952 from the trunk
Modified: home/phd/SQLObject/paramstyles/sqlobject/col.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/col.py 2006-09-26 14:30:17 UTC (rev 1952)
+++ home/phd/SQLObject/paramstyles/sqlobject/col.py 2006-09-26 14:36:15 UTC (rev 1953)
@@ -1253,9 +1253,9 @@
if value is None:
return None
if isinstance(value, str):
- module = state.soObject._connection.module
- if module.__name__ in ("sqlite", "pysqlite2.dbapi2"):
- value = module.decode(value)
+ connection = state.soObject._connection
+ if connection.dbName == "sqlite":
+ value = connection.module.decode(value)
return value
if isinstance(value, (buffer_type, state.soObject._connection._binaryType)):
cachedValue = self._cachedValue
Modified: home/phd/SQLObject/paramstyles/sqlobject/dbconnection.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/dbconnection.py 2006-09-26 14:30:17 UTC (rev 1952)
+++ home/phd/SQLObject/paramstyles/sqlobject/dbconnection.py 2006-09-26 14:36:15 UTC (rev 1953)
@@ -520,6 +520,9 @@
#assert ops.get('orderBy'), "Getting a slice of an unordered set is unpredictable!"
q = self._queryAddLimitOffset(q, start, end)
+ if ops.get('forUpdate'):
+ q += " FOR UPDATE";
+
return q
def _SO_createJoinTable(self, join):
Modified: home/phd/SQLObject/paramstyles/sqlobject/main.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/main.py 2006-09-26 14:30:17 UTC (rev 1952)
+++ home/phd/SQLObject/paramstyles/sqlobject/main.py 2006-09-26 14:36:15 UTC (rev 1953)
@@ -1319,7 +1319,7 @@
orderBy=NoDefault, limit=None,
lazyColumns=False, reversed=False,
distinct=False, connection=None,
- join=None):
+ join=None, forUpdate=False):
return cls.SelectResultsClass(cls, clause,
clauseTables=clauseTables,
orderBy=orderBy,
@@ -1328,7 +1328,7 @@
reversed=reversed,
distinct=distinct,
connection=connection,
- join=join)
+ join=join, forUpdate=forUpdate)
select = classmethod(select)
def selectBy(cls, connection=None, **kw):
Modified: home/phd/SQLObject/paramstyles/sqlobject/sqlite/sqliteconnection.py
===================================================================
--- home/phd/SQLObject/paramstyles/sqlobject/sqlite/sqliteconnection.py 2006-09-26 14:30:17 UTC (rev 1952)
+++ home/phd/SQLObject/paramstyles/sqlobject/sqlite/sqliteconnection.py 2006-09-26 14:36:15 UTC (rev 1953)
@@ -17,11 +17,15 @@
global using_sqlite2
if sqlite is None:
try:
- from pysqlite2 import dbapi2 as sqlite
+ import sqlite3 as sqlite
using_sqlite2 = True
except ImportError:
- import sqlite
- using_sqlite2 = False
+ try:
+ from pysqlite2 import dbapi2 as sqlite
+ using_sqlite2 = True
+ except ImportError:
+ import sqlite
+ using_sqlite2 = False
self.module = sqlite
self.filename = filename # full path to sqlite-db-file
self._memory = filename == ':memory:'
|
|
From: <sub...@co...> - 2006-09-26 14:30:20
|
Author: phd Date: 2006-09-26 08:30:17 -0600 (Tue, 26 Sep 2006) New Revision: 1952 Modified: SQLObject/docs/News.txt Log: sqlite3. Modified: SQLObject/docs/News.txt =================================================================== --- SQLObject/docs/News.txt 2006-09-26 14:22:23 UTC (rev 1951) +++ SQLObject/docs/News.txt 2006-09-26 14:30:17 UTC (rev 1952) @@ -64,6 +64,8 @@ * FOREIGN KEY for MySQL. +* Support for sqlite3 (a builtin module in Python 2.5). + Bug Fixes --------- |
|
From: <sub...@co...> - 2006-09-26 14:22:29
|
Author: phd Date: 2006-09-26 08:22:23 -0600 (Tue, 26 Sep 2006) New Revision: 1951 Modified: SQLObject/trunk/sqlobject/col.py SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py Log: A patch by Humberto Diogenes http://humberto.digi.com.br to use sqlite3 (builtin module in Python 2.5). Modified: SQLObject/trunk/sqlobject/col.py =================================================================== --- SQLObject/trunk/sqlobject/col.py 2006-09-26 12:30:07 UTC (rev 1950) +++ SQLObject/trunk/sqlobject/col.py 2006-09-26 14:22:23 UTC (rev 1951) @@ -1253,9 +1253,9 @@ if value is None: return None if isinstance(value, str): - module = state.soObject._connection.module - if module.__name__ in ("sqlite", "pysqlite2.dbapi2"): - value = module.decode(value) + connection = state.soObject._connection + if connection.dbName == "sqlite": + value = connection.module.decode(value) return value if isinstance(value, (buffer_type, state.soObject._connection._binaryType)): cachedValue = self._cachedValue Modified: SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py =================================================================== --- SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py 2006-09-26 12:30:07 UTC (rev 1950) +++ SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py 2006-09-26 14:22:23 UTC (rev 1951) @@ -17,11 +17,15 @@ global using_sqlite2 if sqlite is None: try: - from pysqlite2 import dbapi2 as sqlite + import sqlite3 as sqlite using_sqlite2 = True except ImportError: - import sqlite - using_sqlite2 = False + try: + from pysqlite2 import dbapi2 as sqlite + using_sqlite2 = True + except ImportError: + import sqlite + using_sqlite2 = False self.module = sqlite self.filename = filename # full path to sqlite-db-file self._memory = filename == ':memory:' |
|
From: <sub...@co...> - 2006-09-26 12:30:14
|
Author: phd
Date: 2006-09-26 06:30:07 -0600 (Tue, 26 Sep 2006)
New Revision: 1950
Modified:
SQLObject/trunk/sqlobject/dbconnection.py
Log:
"FOR UPDATE" should go after limit/offset.
Modified: SQLObject/trunk/sqlobject/dbconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/dbconnection.py 2006-09-26 12:21:09 UTC (rev 1949)
+++ SQLObject/trunk/sqlobject/dbconnection.py 2006-09-26 12:30:07 UTC (rev 1950)
@@ -505,15 +505,15 @@
q = startSelect + ' ' + q
- if ops.get('forUpdate'):
- q += " FOR UPDATE";
-
if limit and (start or end):
# @@: Raising an error might be an annoyance, but some warning is
# in order.
#assert ops.get('orderBy'), "Getting a slice of an unordered set is unpredictable!"
q = self._queryAddLimitOffset(q, start, end)
+ if ops.get('forUpdate'):
+ q += " FOR UPDATE";
+
return q
def _SO_createJoinTable(self, join):
|
|
From: <sub...@co...> - 2006-09-26 12:21:12
|
Author: phd Date: 2006-09-26 06:21:09 -0600 (Tue, 26 Sep 2006) New Revision: 1949 Modified: SQLObject/docs/News.txt SQLObject/docs/SQLObject.txt Log: SELECT FOR UPDATE. Modified: SQLObject/docs/News.txt =================================================================== --- SQLObject/docs/News.txt 2006-09-26 12:08:10 UTC (rev 1948) +++ SQLObject/docs/News.txt 2006-09-26 12:21:09 UTC (rev 1949) @@ -47,6 +47,8 @@ * New joins! ManyToMany and OneToMany; not fully documented yet, but still more sensible and smarter. +* SELECT FOR UPDATE + Small Features -------------- Modified: SQLObject/docs/SQLObject.txt =================================================================== --- SQLObject/docs/SQLObject.txt 2006-09-26 12:08:10 UTC (rev 1948) +++ SQLObject/docs/SQLObject.txt 2006-09-26 12:21:09 UTC (rev 1949) @@ -1292,13 +1292,11 @@ If you want to begin a new transaction after a .rollback() call .begin(). -If you want to use transactions you should also turn `_cacheValues` -off, like: +You can use SELECT FOR UPDATE in those databases that support it:: - class Person(SQLObject): - _cacheValue = False - # ... + Person.select(Person.q.name=="value", forUpdate=True) + Automatic Schema Generation --------------------------- |
|
From: <sub...@co...> - 2006-09-26 12:08:14
|
Author: phd
Date: 2006-09-26 06:08:10 -0600 (Tue, 26 Sep 2006)
New Revision: 1948
Modified:
SQLObject/trunk/sqlobject/dbconnection.py
SQLObject/trunk/sqlobject/main.py
Log:
A patch by David Faure <df...@kl...> implementing
SELECT FOR UPDATE.
Modified: SQLObject/trunk/sqlobject/dbconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/dbconnection.py 2006-09-25 20:18:44 UTC (rev 1947)
+++ SQLObject/trunk/sqlobject/dbconnection.py 2006-09-26 12:08:10 UTC (rev 1948)
@@ -505,6 +505,9 @@
q = startSelect + ' ' + q
+ if ops.get('forUpdate'):
+ q += " FOR UPDATE";
+
if limit and (start or end):
# @@: Raising an error might be an annoyance, but some warning is
# in order.
Modified: SQLObject/trunk/sqlobject/main.py
===================================================================
--- SQLObject/trunk/sqlobject/main.py 2006-09-25 20:18:44 UTC (rev 1947)
+++ SQLObject/trunk/sqlobject/main.py 2006-09-26 12:08:10 UTC (rev 1948)
@@ -1319,7 +1319,7 @@
orderBy=NoDefault, limit=None,
lazyColumns=False, reversed=False,
distinct=False, connection=None,
- join=None):
+ join=None, forUpdate=False):
return cls.SelectResultsClass(cls, clause,
clauseTables=clauseTables,
orderBy=orderBy,
@@ -1328,7 +1328,7 @@
reversed=reversed,
distinct=distinct,
connection=connection,
- join=join)
+ join=join, forUpdate=forUpdate)
select = classmethod(select)
def selectBy(cls, connection=None, **kw):
|
|
From: <sub...@co...> - 2006-09-25 18:11:01
|
Author: ianb Date: 2006-09-25 12:10:57 -0600 (Mon, 25 Sep 2006) New Revision: 1946 Modified: SQLObject/branches/0.7-bugfix/docs/download.txt Log: updated download links Modified: SQLObject/branches/0.7-bugfix/docs/download.txt =================================================================== --- SQLObject/branches/0.7-bugfix/docs/download.txt 2006-09-25 18:00:34 UTC (rev 1945) +++ SQLObject/branches/0.7-bugfix/docs/download.txt 2006-09-25 18:10:57 UTC (rev 1946) @@ -4,18 +4,18 @@ The latest releases are always available on the `Python Cheese Shop <http://cheeseshop.python.org/pypi/SQLObject>`_. -* `SQLObject 0.7rc1 - <http://cheeseshop.python.org/packages/source/S/SQLObject/SQLObject-0.7rc1.tar.gz>`_ +* `SQLObject 0.7.1 + <http://cheeseshop.python.org/packages/source/S/SQLObject/SQLObject-0.7.1.tar.gz>`_ (source package in ``tar.gz`` format) -* `0.7rc1 Python 2.4 egg - <http://cheeseshop.python.org/packages/2.4/S/SQLObject/SQLObject-0.7rc1-py2.4.egg>`_ +* `0.7.1 Python 2.4 egg + <http://cheeseshop.python.org/packages/2.4/S/SQLObject/SQLObject-0.7.1-py2.4.egg>`_ (`easy_install-friendly <http://peak.telecommunity.com/DevCenter/EasyInstall>`__ egg package) -* `0.7rc1 Python 2.3 egg - <http://cheeseshop.python.org/packages/2.3/S/SQLObject/SQLObject-0.7rc1-py2.3.egg>`_ +* `0.7.1 Python 2.3 egg + <http://cheeseshop.python.org/packages/2.3/S/SQLObject/SQLObject-0.7.1-py2.3.egg>`_ (`easy_install-friendly <http://peak.telecommunity.com/DevCenter/EasyInstall>`__ egg package) |
|
From: <sub...@co...> - 2006-09-25 17:14:40
|
Author: ianb Date: 2006-09-25 11:14:35 -0600 (Mon, 25 Sep 2006) New Revision: 1942 Added: SQLObject/tags/0.7.1/ SQLObject/tags/0.7.1/setup.cfg SQLObject/tags/0.7.1/setup.py Removed: SQLObject/tags/0.7.1/setup.cfg SQLObject/tags/0.7.1/setup.py Log: tagging 0.7.1 Copied: SQLObject/tags/0.7.1 (from rev 1940, SQLObject/branches/0.7-bugfix) Deleted: SQLObject/tags/0.7.1/setup.cfg =================================================================== --- SQLObject/branches/0.7-bugfix/setup.cfg 2006-09-25 12:09:51 UTC (rev 1940) +++ SQLObject/tags/0.7.1/setup.cfg 2006-09-25 17:14:35 UTC (rev 1942) @@ -1,33 +0,0 @@ -[egg_info] -tag_build = dev -tag_svn_revision = true - -[pudge] -title = SQLObject -dest = docs/html -docs = docs/index.txt docs/SQLObject.txt docs/TODO.txt - docs/DeveloperGuide.txt docs/FAQ.txt docs/Inheritance.txt - docs/News.txt docs/SQLBuilder.txt docs/sqlobject-admin.txt - docs/community.txt docs/links.txt docs/download.txt - docs/Authors.txt -settings = normal_link_color=#039 - visited_color=#093 - hover_color=#ddf - body_outer_bg_color=#46a - body_border_color=#09f - nav_container_color=#79f - nav_button_color=#037 - nav_border_color=#05f - no_about=true - link1=/SQLObject.html Documentation -modules = sqlobject -doc_base = docs/ -theme = pythonpaste.org -mailing_list_url = http://sqlobject.org/community.html -blog_url = http://sqlobject.org/news/ - -[publish] -doc-dest = scp://ianbicking@shell.sf.net/home/groups/s/sq/sqlobject/htdocs/ -make-dirs = 1 -doc-dir = docs/html - Copied: SQLObject/tags/0.7.1/setup.cfg (from rev 1941, SQLObject/branches/0.7-bugfix/setup.cfg) =================================================================== --- SQLObject/tags/0.7.1/setup.cfg (rev 0) +++ SQLObject/tags/0.7.1/setup.cfg 2006-09-25 17:14:35 UTC (rev 1942) @@ -0,0 +1,29 @@ +[pudge] +title = SQLObject +dest = docs/html +docs = docs/index.txt docs/SQLObject.txt docs/TODO.txt + docs/DeveloperGuide.txt docs/FAQ.txt docs/Inheritance.txt + docs/News.txt docs/SQLBuilder.txt docs/sqlobject-admin.txt + docs/community.txt docs/links.txt docs/download.txt + docs/Authors.txt +settings = normal_link_color=#039 + visited_color=#093 + hover_color=#ddf + body_outer_bg_color=#46a + body_border_color=#09f + nav_container_color=#79f + nav_button_color=#037 + nav_border_color=#05f + no_about=true + link1=/SQLObject.html Documentation +modules = sqlobject +doc_base = docs/ +theme = pythonpaste.org +mailing_list_url = http://sqlobject.org/community.html +blog_url = http://sqlobject.org/news/ + +[publish] +doc-dest = scp://ianbicking@shell.sf.net/home/groups/s/sq/sqlobject/htdocs/ +make-dirs = 1 +doc-dir = docs/html + Deleted: SQLObject/tags/0.7.1/setup.py =================================================================== --- SQLObject/branches/0.7-bugfix/setup.py 2006-09-25 12:09:51 UTC (rev 1940) +++ SQLObject/tags/0.7.1/setup.py 2006-09-25 17:14:35 UTC (rev 1942) @@ -1,122 +0,0 @@ -# ez_setup doesn't work with Python 2.2, so we use distutils -# in that case: -try: - from ez_setup import use_setuptools - use_setuptools() - from setuptools import setup -except ImportError: - from distutils.core import setup - -subpackages = ['firebird', 'inheritance', 'mysql', 'postgres', - 'sqlite', 'sybase', 'maxdb', 'util', 'manager', - 'mssql'] - -import sys -# patch distutils if it can't cope with the "classifiers" keyword -if sys.version < '2.2.3': - from distutils.dist import DistributionMetadata - DistributionMetadata.classifiers = None - DistributionMetadata.download_url = None - -setup(name="SQLObject", - version="0.7.1", - description="Object-Relational Manager, aka database wrapper", - long_description="""\ -SQLObject is a popular *Object Relational Manager* for providing an -object interface to your database, with tables as classes, rows as -instances, and columns as attributes. - -SQLObject includes a Python-object-based query language that makes SQL -more abstract, and provides substantial database independence for -applications. - -Supports MySQL, PostgreSQL, SQLite, Firebird, Sybase, MSSQL and MaxDB (SAPDB). - -The trunk is available in a `Subversion repository -<http://svn.sqlobject.org/SQLObject/trunk#egg=SQLObject-dev>`_ installable with -``easy_install SQLObject==dev`` - -The 0.7 bugfix branch is `also available -<http://svn.sqlobject.org/SQLObject/branches/0.7-bugfix#egg=SQLObject-bugfix>`_ -installable with ``easy_install SQLObject==bugfix``. -""", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", - "Programming Language :: Python", - "Topic :: Database", - "Topic :: Database :: Front-Ends", - "Topic :: Software Development :: Libraries :: Python Modules", - ], - author="Ian Bicking", - author_email="ia...@co...", - url="http://sqlobject.org", - download_url="http://cheeseshop.python.org/pypi/SQLObject/0.7.1", - license="LGPL", - packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], - scripts=["scripts/sqlobject-admin"], - install_requires=["FormEncode>=0.2.2"], - extras_require={ - 'mysql': ['MySQLdb'], - 'postgresql': ['psycopg'], # or pgdb from PyGreSQL - 'sqlite': ['pysqlite'], - 'firebird': ['kinterbasdb'], - 'sybase': ['Sybase'], - 'mssql': ['adodbapi'], # or pymssql - 'sapdb': ['sapdb'], - }, - ) - -# Send announce to: -# sql...@li... -# pyt...@py... -# pyt...@py... -# db...@py... - -# Email tempate: -""" -@@ INTRO - -What is SQLObject -================= - -SQLObject is an object-relational mapper. Your database tables are described -as classes, and rows are instances of those classes. SQLObject is meant to be -easy to use and quick to get started with. - -SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite, and -Firebird. It also has newly added support for Sybase, MSSQL and MaxDB (also -known as SAPDB). - - -Where is SQLObject -================== - -Site: -http://sqlobject.org - -Mailing list: -https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss - -Archives: -http://news.gmane.org/gmane.comp.python.sqlobject - -Download: -http://cheeseshop.python.org/pypi/SQLObject/@@ - -News and changes: -http://sqlobject.org/docs/News.html - - -What's New -========== - -@@ CHANGES - -For a more complete list, please see the news: -http://sqlobject.org/docs/News.html - --- -Ian Bicking / ia...@co... / http://blog.ianbicking.org -""" Copied: SQLObject/tags/0.7.1/setup.py (from rev 1941, SQLObject/branches/0.7-bugfix/setup.py) =================================================================== --- SQLObject/tags/0.7.1/setup.py (rev 0) +++ SQLObject/tags/0.7.1/setup.py 2006-09-25 17:14:35 UTC (rev 1942) @@ -0,0 +1,122 @@ +# ez_setup doesn't work with Python 2.2, so we use distutils +# in that case: +try: + from ez_setup import use_setuptools + use_setuptools() + from setuptools import setup +except ImportError: + from distutils.core import setup + +subpackages = ['firebird', 'inheritance', 'mysql', 'postgres', + 'sqlite', 'sybase', 'maxdb', 'util', 'manager', + 'mssql'] + +import sys +# patch distutils if it can't cope with the "classifiers" keyword +if sys.version < '2.2.3': + from distutils.dist import DistributionMetadata + DistributionMetadata.classifiers = None + DistributionMetadata.download_url = None + +setup(name="SQLObject", + version="0.7.1", + description="Object-Relational Manager, aka database wrapper", + long_description="""\ +SQLObject is a popular *Object Relational Manager* for providing an +object interface to your database, with tables as classes, rows as +instances, and columns as attributes. + +SQLObject includes a Python-object-based query language that makes SQL +more abstract, and provides substantial database independence for +applications. + +Supports MySQL, PostgreSQL, SQLite, Firebird, Sybase, MSSQL and MaxDB (SAPDB). + +The trunk is available in a `Subversion repository +<http://svn.sqlobject.org/SQLObject/trunk#egg=SQLObject-dev>`_ installable with +``easy_install SQLObject==dev`` + +The 0.7 bugfix branch is `also available +<http://svn.sqlobject.org/SQLObject/branches/0.7-bugfix#egg=SQLObject-bugfix>`_ +installable with ``easy_install SQLObject==bugfix``. +""", + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", + "Programming Language :: Python", + "Topic :: Database", + "Topic :: Database :: Front-Ends", + "Topic :: Software Development :: Libraries :: Python Modules", + ], + author="Ian Bicking", + author_email="ia...@co...", + url="http://sqlobject.org", + download_url="http://cheeseshop.python.org/pypi/SQLObject/0.7.1", + license="LGPL", + packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], + scripts=["scripts/sqlobject-admin"], + install_requires=["FormEncode>=0.2.2"], + extras_require={ + 'mysql': ['MySQLdb'], + 'postgresql': ['psycopg'], # or pgdb from PyGreSQL + 'sqlite': ['pysqlite'], + 'firebird': ['kinterbasdb'], + 'sybase': ['Sybase'], + 'mssql': ['adodbapi'], # or pymssql + 'sapdb': ['sapdb'], + }, + ) + +# Send announce to: +# sql...@li... +# pyt...@py... +# pyt...@py... +# db...@py... + +# Email tempate: +""" +@@ INTRO + +What is SQLObject +================= + +SQLObject is an object-relational mapper. Your database tables are described +as classes, and rows are instances of those classes. SQLObject is meant to be +easy to use and quick to get started with. + +SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite, and +Firebird. It also has newly added support for Sybase, MSSQL and MaxDB (also +known as SAPDB). + + +Where is SQLObject +================== + +Site: +http://sqlobject.org + +Mailing list: +https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss + +Archives: +http://news.gmane.org/gmane.comp.python.sqlobject + +Download: +http://cheeseshop.python.org/pypi/SQLObject/@@ + +News and changes: +http://sqlobject.org/docs/News.html + + +What's New +========== + +@@ CHANGES + +For a more complete list, please see the news: +http://sqlobject.org/docs/News.html + +-- +Ian Bicking / ia...@co... / http://blog.ianbicking.org +""" |
|
From: <sub...@co...> - 2006-09-25 17:12:48
|
Author: ianb
Date: 2006-09-25 11:12:44 -0600 (Mon, 25 Sep 2006)
New Revision: 1941
Modified:
SQLObject/branches/0.7-bugfix/setup.cfg
SQLObject/branches/0.7-bugfix/setup.py
Log:
Updating branch to 0.7.2
Modified: SQLObject/branches/0.7-bugfix/setup.cfg
===================================================================
--- SQLObject/branches/0.7-bugfix/setup.cfg 2006-09-25 12:09:51 UTC (rev 1940)
+++ SQLObject/branches/0.7-bugfix/setup.cfg 2006-09-25 17:12:44 UTC (rev 1941)
@@ -1,5 +1,5 @@
[egg_info]
-tag_build = dev
+tag_build = a
tag_svn_revision = true
[pudge]
Modified: SQLObject/branches/0.7-bugfix/setup.py
===================================================================
--- SQLObject/branches/0.7-bugfix/setup.py 2006-09-25 12:09:51 UTC (rev 1940)
+++ SQLObject/branches/0.7-bugfix/setup.py 2006-09-25 17:12:44 UTC (rev 1941)
@@ -19,7 +19,7 @@
DistributionMetadata.download_url = None
setup(name="SQLObject",
- version="0.7.1",
+ version="0.7.2",
description="Object-Relational Manager, aka database wrapper",
long_description="""\
SQLObject is a popular *Object Relational Manager* for providing an
|
|
From: <sub...@co...> - 2006-09-25 12:09:55
|
Author: phd Date: 2006-09-25 06:09:51 -0600 (Mon, 25 Sep 2006) New Revision: 1940 Modified: home/phd/SQLObject/paramstyles/setup.py Log: Merged patches from the revisions 1933:1939 from the trunk Modified: home/phd/SQLObject/paramstyles/setup.py =================================================================== --- home/phd/SQLObject/paramstyles/setup.py 2006-09-25 12:08:15 UTC (rev 1939) +++ home/phd/SQLObject/paramstyles/setup.py 2006-09-25 12:09:51 UTC (rev 1940) @@ -39,8 +39,7 @@ more abstract, and provides substantial database independence for applications. -Supports MySQL, PostgreSQL, SQLite, Firebird, Sybase, and MaxDB -(SAPDB). +Supports MySQL, PostgreSQL, SQLite, Firebird, Sybase, MSSQL and MaxDB (SAPDB). For development see the `subversion repository <http://svn.colorstudy.com/SQLObject/trunk#egg=SQLObject-0.8dev>`_ @@ -57,15 +56,19 @@ author="Ian Bicking", author_email="ia...@co...", url="http://sqlobject.org", + download_url="http://cheeseshop.python.org/pypi/SQLObject/", license="LGPL", packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], scripts=["scripts/sqlobject-admin"], install_requires=["FormEncode>=0.2.2"], extras_require={ - 'postgresql': ['psycopg'], 'mysql': ['MySQLdb'], + 'postgresql': ['psycopg'], # or pgdb from PyGreSQL 'sqlite': ['pysqlite'], - # Others? + 'firebird': ['kinterbasdb'], + 'sybase': ['Sybase'], + 'mssql': ['adodbapi'], # or pymssql + 'sapdb': ['sapdb'], }, **kw ) |
|
From: <sub...@co...> - 2006-09-25 12:08:17
|
Author: phd Date: 2006-09-25 06:08:15 -0600 (Mon, 25 Sep 2006) New Revision: 1939 Modified: SQLObject/trunk/setup.py Log: Minor update. Added download_url and extended extra reuirements. Modified: SQLObject/trunk/setup.py =================================================================== --- SQLObject/trunk/setup.py 2006-09-25 12:07:05 UTC (rev 1938) +++ SQLObject/trunk/setup.py 2006-09-25 12:08:15 UTC (rev 1939) @@ -39,8 +39,7 @@ more abstract, and provides substantial database independence for applications. -Supports MySQL, PostgreSQL, SQLite, Firebird, Sybase, and MaxDB -(SAPDB). +Supports MySQL, PostgreSQL, SQLite, Firebird, Sybase, MSSQL and MaxDB (SAPDB). For development see the `subversion repository <http://svn.colorstudy.com/SQLObject/trunk#egg=SQLObject-0.8dev>`_ @@ -57,15 +56,19 @@ author="Ian Bicking", author_email="ia...@co...", url="http://sqlobject.org", + download_url="http://cheeseshop.python.org/pypi/SQLObject/", license="LGPL", packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], scripts=["scripts/sqlobject-admin"], install_requires=["FormEncode>=0.2.2"], extras_require={ - 'postgresql': ['psycopg'], 'mysql': ['MySQLdb'], + 'postgresql': ['psycopg'], # or pgdb from PyGreSQL 'sqlite': ['pysqlite'], - # Others? + 'firebird': ['kinterbasdb'], + 'sybase': ['Sybase'], + 'mssql': ['adodbapi'], # or pymssql + 'sapdb': ['sapdb'], }, **kw ) |
|
From: <sub...@co...> - 2006-09-25 12:07:09
|
Author: phd Date: 2006-09-25 06:07:05 -0600 (Mon, 25 Sep 2006) New Revision: 1938 Modified: SQLObject/branches/0.7-bugfix/setup.py Log: Minor update. Added download_url and extended extra reuirements. Modified: SQLObject/branches/0.7-bugfix/setup.py =================================================================== --- SQLObject/branches/0.7-bugfix/setup.py 2006-09-18 21:34:23 UTC (rev 1937) +++ SQLObject/branches/0.7-bugfix/setup.py 2006-09-25 12:07:05 UTC (rev 1938) @@ -30,8 +30,7 @@ more abstract, and provides substantial database independence for applications. -Supports MySQL, PostgreSQL, SQLite, Firebird, Sybase, and MaxDB -(SAPDB). +Supports MySQL, PostgreSQL, SQLite, Firebird, Sybase, MSSQL and MaxDB (SAPDB). The trunk is available in a `Subversion repository <http://svn.sqlobject.org/SQLObject/trunk#egg=SQLObject-dev>`_ installable with @@ -53,15 +52,19 @@ author="Ian Bicking", author_email="ia...@co...", url="http://sqlobject.org", + download_url="http://cheeseshop.python.org/pypi/SQLObject/0.7.1", license="LGPL", packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], scripts=["scripts/sqlobject-admin"], install_requires=["FormEncode>=0.2.2"], extras_require={ - 'postgresql': ['psycopg'], 'mysql': ['MySQLdb'], + 'postgresql': ['psycopg'], # or pgdb from PyGreSQL 'sqlite': ['pysqlite'], - # Others? + 'firebird': ['kinterbasdb'], + 'sybase': ['Sybase'], + 'mssql': ['adodbapi'], # or pymssql + 'sapdb': ['sapdb'], }, ) |
|
From: <sub...@co...> - 2006-09-18 15:22:47
|
Author: phd
Date: 2006-09-18 09:22:42 -0600 (Mon, 18 Sep 2006)
New Revision: 1933
Modified:
SQLObject/docs/SQLObject.txt
Log:
Minor documentation update.
Modified: SQLObject/docs/SQLObject.txt
===================================================================
--- SQLObject/docs/SQLObject.txt 2006-09-18 15:22:24 UTC (rev 1932)
+++ SQLObject/docs/SQLObject.txt 2006-09-18 15:22:42 UTC (rev 1933)
@@ -1111,7 +1111,8 @@
`PickleCol`:
An extension of BLOBCol; this column can store/retrieve any Python object;
it actually (un)pickles the object from/to string and stores/retrieves the
- string.
+ string. One can get and set the value of the column but cannot search
+ (use it in WHERE).
`StringCol`:
A string (character) column. Extra keywords:
|
|
From: <sub...@co...> - 2006-09-18 15:22:29
|
Author: phd
Date: 2006-09-18 09:22:24 -0600 (Mon, 18 Sep 2006)
New Revision: 1932
Modified:
SQLObject/branches/0.7-bugfix/docs/SQLObject.txt
Log:
Minor documentation update.
Modified: SQLObject/branches/0.7-bugfix/docs/SQLObject.txt
===================================================================
--- SQLObject/branches/0.7-bugfix/docs/SQLObject.txt 2006-09-11 03:16:45 UTC (rev 1931)
+++ SQLObject/branches/0.7-bugfix/docs/SQLObject.txt 2006-09-18 15:22:24 UTC (rev 1932)
@@ -1110,7 +1110,8 @@
`PickleCol`:
An extension of BLOBCol; this column can store/retrieve any Python object;
it actually (un)pickles the object from/to string and stores/retrieves the
- string.
+ string. One can get and set the value of the column but cannot search
+ (use it in WHERE).
`StringCol`:
A string (character) column. Extra keywords:
|
|
From: SourceForge.net <no...@so...> - 2006-09-17 15:30:46
|
Bugs item #1463974, was opened at 2006-04-04 08:20 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1463974&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General Group: SQLObject release (specify) Status: Open >Resolution: Later Priority: 5 Submitted By: Patrick Coleman (ptrck) >Assigned to: Oleg Broytmann (phd) Summary: Column name collides with internal method Initial Comment: Hi, My database has a column 'expire' in a certain table. It appears that when SQLObject calls expire() (line 778, dbconnection.py) on a cache object from that table, rather than calling the expire method to expire the object from cache it actually returns the value from the 'expire' column, which being a Long of course isn't callable, resulting in the attached exception. I propose that internal methods used by SQLObject use names that are unlikely to collide with column names (perhaps by prepending __SQLObject__ or similar), and that these internal names be documented so database designers can avoid using names that may collide. SQLObject is SQLObject-0.7.0-py2.4, as shipped with Turbogears 0.8a3-py2.4. Thanks, Patrick -- http://www.labyrinthdata.net.au ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2006-09-17 19:30 Message: Logged In: YES user_id=4799 I am going to implement the third solution - do not allow to add a column with a colliding name. There is a problem, though, with fromDatabase. With fromDatabase=True SQLObject draws columns from the database metadata, and there is a chance of collision. I haven't decided yet what to do - just raise an error, automatically rename the column in SQLObject, allow user to override the name... ---------------------------------------------------------------------- Comment By: Patrick Coleman (ptrck) Date: 2006-09-07 20:03 Message: Logged In: YES user_id=646977 Thanks for the suggestion - I'll give it a try. However the problem, as I'm sure you realise, is *not* that the column 'expire' in my database is inaccessible. The problem is that *all transaction support* in SQLObject completely breaks when a column called 'expire' exists anywhere in the database. Specifically, rollbacks don't work at all which more or less defeats the point of transactions. The result for end users is that when they install SQLObject on an existing database with a column called 'expire', SQLObject breaks inexplicably. There is no documentation of this behaviour, and so most people are just going to conclude that SQLObject is broken, rather than performing this workaround. I agree that expire is a public method, but I feel that perhaps the current behavior should be modified so that: - SQLObject noticies a column the same name as a public method and throws a meaningful error; or - SQLObject noticies a column the same name as a public method and overrides the public method with the column method (but internally continues to use the non-column public method, so that eg. transactions do not break as they do now); or - SQLObject notices a column the same name as a public method and refuses to publish the column method. --Patrick ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-09-07 19:43 Message: Logged In: YES user_id=4799 But .expire is not an internal method - it is perfectly valid public method. Now think you read or write inst.__SQLObject__expire() in some code instead of inst.expire()! The workaround would be to made the column's name and db anme different: local_expire = DateTimeCol(dbName="expire") Now you can access inst.local_expire (or whatever you name it) and call inst.expire(). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1463974&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-09-09 18:06:23
|
Bugs item #1432190, was opened at 2006-02-15 09:22 Message generated for change (Comment added) made by abadger1999 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1432190&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: BjLindqvist (sonderblade) Assigned to: Oleg Broytmann (phd) Summary: Table creation order for foreign key constraints Initial Comment: Note: I had to apply my patch in https://sourceforge.net/tracker/index.php?func=detail&aid=1432176&group_id=74338&atid=540674 otherwise the foreign key constrains would be completely ignored. I have a simple model.py file containing my two tables like this: class Network(SQLObject): name = StringCol(alternateID = True, length = 80) class Channel(SQLObject): network = ForeignKey("Network", notNull = True) name = StringCol() Using "tg-admin sql sql" produces a listing like this: CREATE TABLE channel ( id INT PRIMARY KEY AUTO_INCREMENT, network_id INT NOT NULL, name TEXT ); CREATE TABLE network ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(80) NOT NULL UNIQUE ); ALTER TABLE channel ADD CONSTRAINT channel_network_id_exists FOREIGN KEY (network_id) REFERENCES network (id); Creating these two tables manually work: Network.createTable() Channel.createTable() But when I try to create them using "tg-admin sql create" (which just wraps "sqlobject-admin create") I get the following exception: Traceback (most recent call last): File "/usr/bin/tg-admin", line 7, in ? sys.exit( File "/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r778-py2.4.egg/turbogears/command/base.py", line 269, in main command.run() File "/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r778-py2.4.egg/turbogears/command/base.py", line 129, in run command.the_runner.run(sys.argv) File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/manager/command.py", line 100, in run runner.run() File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/manager/command.py", line 231, in run self.command() File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/manager/command.py", line 583, in command tableConstraints = soClass.createTable() File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/main.py", line 1372, in createTable conn.query(constraint) File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/dbconnection.py", line 314, in query return self._runWithConnection(self._query, s) File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/dbconnection.py", line 228, in _runWithConnection val = meth(conn, *args) File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/dbconnection.py", line 311, in _query self._executeRetry(conn, conn.cursor(), s) File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/mysql/mysqlconnection.py", line 66, in _executeRetry return cursor.execute(query) File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line 137, in execute self.errorhandler(self, exc, value) File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line 33, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.OperationalError: (1005, "Can't create table './test/#sql-1cf0_b9.frm' (errno: 150)") The problem is because sqlobject creates the Channel table before the Network table and therefore the query (despite the order that "tg-admin sql sql" seem to suggest): ALTER TABLE channel ADD CONSTRAINT channel_network_id_exists FOREIGN KEY (network_id) REFERENCES network (id); is executed before the Network table has been created. I think the problem can be solved by making it so all constraint statements are executed after the create table statements are executed. ---------------------------------------------------------------------- Comment By: Toshio Kuratomi (abadger1999) Date: 2006-09-09 14:06 Message: Logged In: YES user_id=944205 Or perhaps I'll paste it inline... There doesn't seem to be a way for a mere commenter to attach a file. Also note: The turbogears bug suggests that the patch will also fix the problem with dropping tables reported in this SQLObject Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1495030&group_id=74338&atid=540672 ---BEGIN TEST CASE--- from sqlobject import * from turbogears.database import PackageHub hub = PackageHub('packagedb') __connection__ = hub class Collection(SQLObject): name = StringCol(length=128, notNone=True) class Branch(SQLObject): collection = ForeignKey('Collection') ---END TEST CASE--- ---------------------------------------------------------------------- Comment By: Toshio Kuratomi (abadger1999) Date: 2006-09-09 14:02 Message: Logged In: YES user_id=944205 This problem affects postgresql as well so I doubt that https://sourceforge.net/tracker/index.php?func=detail&aid=1432176&group_id=74338&atid=540674 will help it. Also, that patch looks like it is aimed at getting foreign keys to work in mysql (otherwise they're ignored.) There is a patch in the TurboGears trac that addresses this issue: Bug: http://trac.turbogears.org/turbogears/ticket/279 Patch: http://trac.turbogears.org/turbogears/attachment/ticket/279/command.patch The patch orders the table creations so that tables with foreign keys are created after the tables they reference. I've tested this patch successfully with a simple model from TurboGears which I'll attach. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-05-23 09:22 Message: Logged In: YES user_id=4799 The patch https://sourceforge.net/tracker/index.php?func=detail&aid=1432176&group_id=74338&atid=540674 was applied. Does it help? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1432190&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2006-09-09 18:02:34
|
Bugs item #1432190, was opened at 2006-02-15 09:22 Message generated for change (Comment added) made by abadger1999 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1432190&group_id=74338 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: BjLindqvist (sonderblade) Assigned to: Oleg Broytmann (phd) Summary: Table creation order for foreign key constraints Initial Comment: Note: I had to apply my patch in https://sourceforge.net/tracker/index.php?func=detail&aid=1432176&group_id=74338&atid=540674 otherwise the foreign key constrains would be completely ignored. I have a simple model.py file containing my two tables like this: class Network(SQLObject): name = StringCol(alternateID = True, length = 80) class Channel(SQLObject): network = ForeignKey("Network", notNull = True) name = StringCol() Using "tg-admin sql sql" produces a listing like this: CREATE TABLE channel ( id INT PRIMARY KEY AUTO_INCREMENT, network_id INT NOT NULL, name TEXT ); CREATE TABLE network ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(80) NOT NULL UNIQUE ); ALTER TABLE channel ADD CONSTRAINT channel_network_id_exists FOREIGN KEY (network_id) REFERENCES network (id); Creating these two tables manually work: Network.createTable() Channel.createTable() But when I try to create them using "tg-admin sql create" (which just wraps "sqlobject-admin create") I get the following exception: Traceback (most recent call last): File "/usr/bin/tg-admin", line 7, in ? sys.exit( File "/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r778-py2.4.egg/turbogears/command/base.py", line 269, in main command.run() File "/usr/lib/python2.4/site-packages/TurboGears-0.9a0dev_r778-py2.4.egg/turbogears/command/base.py", line 129, in run command.the_runner.run(sys.argv) File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/manager/command.py", line 100, in run runner.run() File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/manager/command.py", line 231, in run self.command() File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/manager/command.py", line 583, in command tableConstraints = soClass.createTable() File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/main.py", line 1372, in createTable conn.query(constraint) File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/dbconnection.py", line 314, in query return self._runWithConnection(self._query, s) File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/dbconnection.py", line 228, in _runWithConnection val = meth(conn, *args) File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/dbconnection.py", line 311, in _query self._executeRetry(conn, conn.cursor(), s) File "/usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1596-py2.4.egg/sqlobject/mysql/mysqlconnection.py", line 66, in _executeRetry return cursor.execute(query) File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line 137, in execute self.errorhandler(self, exc, value) File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line 33, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.OperationalError: (1005, "Can't create table './test/#sql-1cf0_b9.frm' (errno: 150)") The problem is because sqlobject creates the Channel table before the Network table and therefore the query (despite the order that "tg-admin sql sql" seem to suggest): ALTER TABLE channel ADD CONSTRAINT channel_network_id_exists FOREIGN KEY (network_id) REFERENCES network (id); is executed before the Network table has been created. I think the problem can be solved by making it so all constraint statements are executed after the create table statements are executed. ---------------------------------------------------------------------- Comment By: Toshio Kuratomi (abadger1999) Date: 2006-09-09 14:02 Message: Logged In: YES user_id=944205 This problem affects postgresql as well so I doubt that https://sourceforge.net/tracker/index.php?func=detail&aid=1432176&group_id=74338&atid=540674 will help it. Also, that patch looks like it is aimed at getting foreign keys to work in mysql (otherwise they're ignored.) There is a patch in the TurboGears trac that addresses this issue: Bug: http://trac.turbogears.org/turbogears/ticket/279 Patch: http://trac.turbogears.org/turbogears/attachment/ticket/279/command.patch The patch orders the table creations so that tables with foreign keys are created after the tables they reference. I've tested this patch successfully with a simple model from TurboGears which I'll attach. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2006-05-23 09:22 Message: Logged In: YES user_id=4799 The patch https://sourceforge.net/tracker/index.php?func=detail&aid=1432176&group_id=74338&atid=540674 was applied. Does it help? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1432190&group_id=74338 |
|
From: <sub...@co...> - 2006-09-09 15:06:35
|
Author: phd Date: 2006-09-09 09:06:33 -0600 (Sat, 09 Sep 2006) New Revision: 1927 Modified: home/phd/SQLObject/paramstyles/setup.py Log: Merged patches from the revisions 1924:1926 from the trunk Modified: home/phd/SQLObject/paramstyles/setup.py =================================================================== --- home/phd/SQLObject/paramstyles/setup.py 2006-09-09 15:04:45 UTC (rev 1926) +++ home/phd/SQLObject/paramstyles/setup.py 2006-09-09 15:06:33 UTC (rev 1927) @@ -105,7 +105,7 @@ http://news.gmane.org/gmane.comp.python.sqlobject Download: -http://cheeseshop.python.org/pypi/SQLObject/ +http://cheeseshop.python.org/pypi/SQLObject/@@ News and changes: http://sqlobject.org/docs/News.html |
|
From: <sub...@co...> - 2006-09-09 15:04:46
|
Author: phd Date: 2006-09-09 09:04:45 -0600 (Sat, 09 Sep 2006) New Revision: 1926 Modified: SQLObject/branches/0.7-bugfix/setup.py Log: Mark a place where a version string should be. Modified: SQLObject/branches/0.7-bugfix/setup.py =================================================================== --- SQLObject/branches/0.7-bugfix/setup.py 2006-09-09 15:03:54 UTC (rev 1925) +++ SQLObject/branches/0.7-bugfix/setup.py 2006-09-09 15:04:45 UTC (rev 1926) @@ -100,7 +100,7 @@ http://news.gmane.org/gmane.comp.python.sqlobject Download: -http://cheeseshop.python.org/pypi/SQLObject/ +http://cheeseshop.python.org/pypi/SQLObject/@@ News and changes: http://sqlobject.org/docs/News.html |
|
From: <sub...@co...> - 2006-09-09 15:03:59
|
Author: phd Date: 2006-09-09 09:03:54 -0600 (Sat, 09 Sep 2006) New Revision: 1925 Modified: SQLObject/trunk/setup.py Log: Mark a place where a version string should be. Modified: SQLObject/trunk/setup.py =================================================================== --- SQLObject/trunk/setup.py 2006-09-08 19:39:11 UTC (rev 1924) +++ SQLObject/trunk/setup.py 2006-09-09 15:03:54 UTC (rev 1925) @@ -105,7 +105,7 @@ http://news.gmane.org/gmane.comp.python.sqlobject Download: -http://cheeseshop.python.org/pypi/SQLObject/ +http://cheeseshop.python.org/pypi/SQLObject/@@ News and changes: http://sqlobject.org/docs/News.html |
|
From: <sub...@co...> - 2006-09-08 19:39:13
|
Author: phd Date: 2006-09-08 13:39:11 -0600 (Fri, 08 Sep 2006) New Revision: 1924 Modified: home/phd/SQLObject/paramstyles/setup.py Log: Merged patches from the revisions 1919:1923 from the trunk Modified: home/phd/SQLObject/paramstyles/setup.py =================================================================== --- home/phd/SQLObject/paramstyles/setup.py 2006-09-08 19:38:21 UTC (rev 1923) +++ home/phd/SQLObject/paramstyles/setup.py 2006-09-08 19:39:11 UTC (rev 1924) @@ -72,9 +72,9 @@ # Send announce to: # sql...@li... -# db...@py... # pyt...@py... # pyt...@py... +# db...@py... # Email tempate: """ |
|
From: <sub...@co...> - 2006-09-08 19:38:22
|
Author: phd Date: 2006-09-08 13:38:21 -0600 (Fri, 08 Sep 2006) New Revision: 1923 Modified: SQLObject/branches/0.7-bugfix/setup.py Log: Changed the order of the mailing lists to look nicer. :) Modified: SQLObject/branches/0.7-bugfix/setup.py =================================================================== --- SQLObject/branches/0.7-bugfix/setup.py 2006-09-08 19:38:01 UTC (rev 1922) +++ SQLObject/branches/0.7-bugfix/setup.py 2006-09-08 19:38:21 UTC (rev 1923) @@ -67,9 +67,9 @@ # Send announce to: # sql...@li... -# db...@py... # pyt...@py... # pyt...@py... +# db...@py... # Email tempate: """ |
|
From: <sub...@co...> - 2006-09-08 19:38:03
|
Author: phd Date: 2006-09-08 13:38:01 -0600 (Fri, 08 Sep 2006) New Revision: 1922 Modified: SQLObject/branches/0.7-bugfix/docs/News.txt Log: Fixed a misspelling. Modified: SQLObject/branches/0.7-bugfix/docs/News.txt =================================================================== --- SQLObject/branches/0.7-bugfix/docs/News.txt 2006-09-08 19:37:36 UTC (rev 1921) +++ SQLObject/branches/0.7-bugfix/docs/News.txt 2006-09-08 19:38:01 UTC (rev 1922) @@ -27,7 +27,7 @@ instead you must manually create it (e.g., with explicit SQLObject classes for the joins). -* Implemented ``RLIKE`` (reguluar expression LIKE). +* Implemented ``RLIKE`` (regular expression LIKE). * Moved _idSequence to sqlmeta.idSequence. |
|
From: <sub...@co...> - 2006-09-08 19:37:37
|
Author: phd Date: 2006-09-08 13:37:36 -0600 (Fri, 08 Sep 2006) New Revision: 1921 Modified: SQLObject/trunk/setup.py Log: Changed the order of the mailing lists to look nicer. :) Modified: SQLObject/trunk/setup.py =================================================================== --- SQLObject/trunk/setup.py 2006-09-08 19:36:25 UTC (rev 1920) +++ SQLObject/trunk/setup.py 2006-09-08 19:37:36 UTC (rev 1921) @@ -72,9 +72,9 @@ # Send announce to: # sql...@li... -# db...@py... # pyt...@py... # pyt...@py... +# db...@py... # Email tempate: """ |
|
From: <sub...@co...> - 2006-09-08 19:36:28
|
Author: phd Date: 2006-09-08 13:36:25 -0600 (Fri, 08 Sep 2006) New Revision: 1920 Modified: SQLObject/docs/News.txt Log: Fixed a misspelling. Modified: SQLObject/docs/News.txt =================================================================== --- SQLObject/docs/News.txt 2006-09-08 18:57:56 UTC (rev 1919) +++ SQLObject/docs/News.txt 2006-09-08 19:36:25 UTC (rev 1920) @@ -87,7 +87,7 @@ instead you must manually create it (e.g., with explicit SQLObject classes for the joins). -* Implemented ``RLIKE`` (reguluar expression LIKE). +* Implemented ``RLIKE`` (regular expression LIKE). * Moved _idSequence to sqlmeta.idSequence. |