sqlobject-discuss Mailing List for SQLObject (Page 47)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
2003 |
Jan
|
Feb
(2) |
Mar
(43) |
Apr
(204) |
May
(208) |
Jun
(102) |
Jul
(113) |
Aug
(63) |
Sep
(88) |
Oct
(85) |
Nov
(95) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(38) |
Feb
(93) |
Mar
(125) |
Apr
(89) |
May
(66) |
Jun
(65) |
Jul
(53) |
Aug
(65) |
Sep
(79) |
Oct
(60) |
Nov
(171) |
Dec
(176) |
2005 |
Jan
(264) |
Feb
(260) |
Mar
(145) |
Apr
(153) |
May
(192) |
Jun
(166) |
Jul
(265) |
Aug
(340) |
Sep
(300) |
Oct
(469) |
Nov
(316) |
Dec
(235) |
2006 |
Jan
(236) |
Feb
(156) |
Mar
(229) |
Apr
(221) |
May
(257) |
Jun
(161) |
Jul
(97) |
Aug
(169) |
Sep
(159) |
Oct
(400) |
Nov
(136) |
Dec
(134) |
2007 |
Jan
(152) |
Feb
(101) |
Mar
(115) |
Apr
(120) |
May
(129) |
Jun
(82) |
Jul
(118) |
Aug
(82) |
Sep
(30) |
Oct
(101) |
Nov
(137) |
Dec
(53) |
2008 |
Jan
(83) |
Feb
(139) |
Mar
(55) |
Apr
(69) |
May
(82) |
Jun
(31) |
Jul
(66) |
Aug
(30) |
Sep
(21) |
Oct
(37) |
Nov
(41) |
Dec
(65) |
2009 |
Jan
(69) |
Feb
(46) |
Mar
(22) |
Apr
(20) |
May
(39) |
Jun
(30) |
Jul
(36) |
Aug
(58) |
Sep
(38) |
Oct
(20) |
Nov
(10) |
Dec
(11) |
2010 |
Jan
(24) |
Feb
(63) |
Mar
(22) |
Apr
(72) |
May
(8) |
Jun
(13) |
Jul
(35) |
Aug
(23) |
Sep
(12) |
Oct
(26) |
Nov
(11) |
Dec
(30) |
2011 |
Jan
(15) |
Feb
(44) |
Mar
(36) |
Apr
(26) |
May
(27) |
Jun
(10) |
Jul
(28) |
Aug
(12) |
Sep
|
Oct
|
Nov
(17) |
Dec
(16) |
2012 |
Jan
(12) |
Feb
(31) |
Mar
(23) |
Apr
(14) |
May
(10) |
Jun
(26) |
Jul
|
Aug
(2) |
Sep
(2) |
Oct
(1) |
Nov
|
Dec
(6) |
2013 |
Jan
(4) |
Feb
(5) |
Mar
|
Apr
(4) |
May
(13) |
Jun
(7) |
Jul
(5) |
Aug
(15) |
Sep
(25) |
Oct
(18) |
Nov
(7) |
Dec
(3) |
2014 |
Jan
(1) |
Feb
(5) |
Mar
|
Apr
(3) |
May
(3) |
Jun
(2) |
Jul
(4) |
Aug
(5) |
Sep
|
Oct
(11) |
Nov
|
Dec
(62) |
2015 |
Jan
(8) |
Feb
(3) |
Mar
(15) |
Apr
|
May
|
Jun
(6) |
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
(19) |
2016 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(4) |
May
(3) |
Jun
(7) |
Jul
(14) |
Aug
(13) |
Sep
(6) |
Oct
(2) |
Nov
(3) |
Dec
|
2017 |
Jan
(6) |
Feb
(14) |
Mar
(2) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(4) |
Nov
(3) |
Dec
|
2018 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
(44) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
2021 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2025 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Oleg B. <ph...@ph...> - 2009-09-30 12:58:11
|
Hello! I'm pleased to announce version 0.11.2, a minor bugfix release of 0.11 branch of SQLObject. 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, Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB). Where is SQLObject ================== Site: http://sqlobject.org Development: http://sqlobject.org/devel/ 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/0.11.2 News and changes: http://sqlobject.org/News.html What's New ========== News since 0.11.1 ----------------- * Fixed a bug in logging to console - convert unicode to str. * Fixed an obscure bug in ConnectionHub triggered by an SQLObject class whose instances can be coerced to boolean False. For a more complete list, please see the news: http://sqlobject.org/News.html Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Oleg B. <ph...@ph...> - 2009-09-30 12:58:03
|
Hello! I'm pleased to announce version 0.10.8, a minor bugfix release of 0.10 branch of SQLObject. 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, Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB). Where is SQLObject ================== Site: http://sqlobject.org Development: http://sqlobject.org/devel/ 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/0.10.8 News and changes: http://sqlobject.org/News.html What's New ========== News since 0.10.7 ----------------- * Fixed a bug in logging to console - convert unicode to str. * Fixed an obscure bug in ConnectionHub triggered by an SQLObject class whose instances can be coerced to boolean False. For a more complete list, please see the news: http://sqlobject.org/News.html Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Oleg B. <ph...@ph...> - 2009-09-30 10:58:29
|
On Wed, Sep 30, 2009 at 11:28:28AM +0100, Chris Wood wrote: > Excellent, that works! Thanks. Good. > 2009/9/30 Oleg Broytman <ph...@ph...> > > > (Answering to the list...) > > > > On Wed, Sep 30, 2009 at 10:33:18AM +0100, Chris Wood wrote: > > > class Cruise(sqlobject.SQLObject): > > > connection = conn > > > class sqlmeta: > > > table = Table1 > > > idName = 'Table1ID' > > > fromDatabase = True > > > style = styles.Style() > > > testList = sqlmeta.columns > > > > > > print Cruise.sqlmeta.testList Now explanation. You have assigned testList long before SQLObject populates sqlmeta.columns. In sqlmeta.setClass() SQLObject reassigns sqlmeta.columns but your testList stays empty. Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Chris W. <c.c...@gm...> - 2009-09-30 10:28:59
|
Excellent, that works! Thanks. 2009/9/30 Oleg Broytman <ph...@ph...> > (Answering to the list...) > > On Wed, Sep 30, 2009 at 10:33:18AM +0100, Chris Wood wrote: > > class Cruise(sqlobject.SQLObject): > > connection = conn > > class sqlmeta: > > table = Table1 > > idName = 'Table1ID' > > fromDatabase = True > > style = styles.Style() > > testList = sqlmeta.columns > > > > print Cruise.sqlmeta.testList > > Why do you do this? Why not just > > print Cruise.sqlmeta.columns > > ? > > Oleg. > -- > Oleg Broytman http://phd.pp.ru/ ph...@ph... > Programmers don't die, they just GOSUB without RETURN. > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss > |
From: Oleg B. <ph...@ph...> - 2009-09-30 09:35:48
|
(Answering to the list...) On Wed, Sep 30, 2009 at 10:33:18AM +0100, Chris Wood wrote: > class Cruise(sqlobject.SQLObject): > connection = conn > class sqlmeta: > table = Table1 > idName = 'Table1ID' > fromDatabase = True > style = styles.Style() > testList = sqlmeta.columns > > print Cruise.sqlmeta.testList Why do you do this? Why not just print Cruise.sqlmeta.columns ? Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Oleg B. <ph...@ph...> - 2009-09-30 08:49:34
|
On Wed, Sep 30, 2009 at 09:36:15AM +0100, Chris Wood wrote: > My column names don't (I don't think - I can't tell) follow one of the > standard styles. Do I need to create them all manually like: > > BOB = StringCol(dbName="BOB") > > or can I use the columns (or columnsList?) dictionary? If I can use columns, > how do I actually initialise / fill the dictionary? Either try simple (one-to-one) style, or name you columns explicitly. I.e., either class Table1(sqlobject.SQLObject): class sqlmeta: table = 'Table1' idName = 'Table1ID' fromDatabase = True style = styles.Style() _connection = conn or class Table1(sqlobject.SQLObject): class sqlmeta: table = 'Table1' idName = 'Table1ID' _connection = conn BOB = StringCol(dbName='BOB') Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Chris W. <c.c...@gm...> - 2009-09-30 08:36:49
|
Hi Oleg, Thanks for this, but I'm still slightly confused. My column names don't (I don't think - I can't tell) follow one of the standard styles. Do I need to create them all manually like: BOB = StringCol(dbName="BOB") or can I use the columns (or columnsList?) dictionary? If I can use columns, how do I actually initialise / fill the dictionary? Thanks, Chris 2009/9/29 Oleg Broytman <ph...@ph...> > On Tue, Sep 29, 2009 at 09:03:51AM +0100, Chris Wood wrote: > > I'm new to using SQLObject, > > Welcome! > > > and having some problems with getting it > > to recognise my current MySQL database. > > Making SQLObject to work with existing databases could be problematic, > sometimes even impossible; let's hope it's not your case. > > > class Table1(sqlobject.SQLObject): > > _connection = conn > > _fromDatabase = True > > > > class sqlmeta: > > table = 'Table1' > > idName = 'Table1ID' > > > > BOB = StringCol() > > You don't need both _fromDatabase and columns. Either you use > _fromDatabase and allow SQLObject to get the list of columns from the > backend, or you declare your columns yourself. > > > I've seen the attribute in class sqlmeta of 'columns' - will this find > > my column names automatically, > > Yes, if _fromDatabase = True. > > > or do I still need to input them > > manually? If the latter..: > > Yes, if _fromDatabase = False. > > > I assume I set the names of each column in the instance of sqlmeta > > (like I have done with the table name) - how do I do this?! Do I do > > this before or after I've told SQLObject that the BOB column is a > > String column? > > SQLObject processes your class declaration as a whole so it doesn't > matter (if I understand your question correctly). > > class Table1(sqlobject.SQLObject): > _connection = conn > > class sqlmeta: > table = 'Table1' > idName = 'Table1ID' > > BOB = StringCol() > > is the same as > > class Table1(sqlobject.SQLObject): > class sqlmeta: > table = 'Table1' > idName = 'Table1ID' > > _connection = conn > BOB = StringCol() > > is the same as > > class Table1(sqlobject.SQLObject): > _connection = conn > BOB = StringCol() > > class sqlmeta: > table = 'Table1' > idName = 'Table1ID' > > (See - I didn't use _fromDatabase and SQLObject assumes it's False and > expects you to provide a list of columns) > > > Is there a published list of the default naming convention that > > SQLObject follows? I couldn't find it on the website. > > SQLObject uses "style" to convert names between Python and backend. See > styles.py for existing styles. Default style is MixedCaseUnderscoreStyle > but > you can change it for a class (table), a group of classes or the entire > program. > If you don't want to override the entire style but only want to change a > few names (of if your existing DB doesn't follow any style at all) - you > can set the names for the table and the columns: > > class Table1(sqlobject.SQLObject): > class sqlmeta: > table = 'Table1' > idName = 'Table1ID' > > _connection = conn > BOB = StringCol(dbName='strbob') > > Oleg. > -- > Oleg Broytman http://phd.pp.ru/ ph...@ph... > Programmers don't die, they just GOSUB without RETURN. > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss > |
From: Oleg B. <ph...@ph...> - 2009-09-29 10:59:15
|
On Tue, Sep 29, 2009 at 09:03:51AM +0100, Chris Wood wrote: > I'm new to using SQLObject, Welcome! > and having some problems with getting it > to recognise my current MySQL database. Making SQLObject to work with existing databases could be problematic, sometimes even impossible; let's hope it's not your case. > class Table1(sqlobject.SQLObject): > _connection = conn > _fromDatabase = True > > class sqlmeta: > table = 'Table1' > idName = 'Table1ID' > > BOB = StringCol() You don't need both _fromDatabase and columns. Either you use _fromDatabase and allow SQLObject to get the list of columns from the backend, or you declare your columns yourself. > I've seen the attribute in class sqlmeta of 'columns' - will this find > my column names automatically, Yes, if _fromDatabase = True. > or do I still need to input them > manually? If the latter..: Yes, if _fromDatabase = False. > I assume I set the names of each column in the instance of sqlmeta > (like I have done with the table name) - how do I do this?! Do I do > this before or after I've told SQLObject that the BOB column is a > String column? SQLObject processes your class declaration as a whole so it doesn't matter (if I understand your question correctly). class Table1(sqlobject.SQLObject): _connection = conn class sqlmeta: table = 'Table1' idName = 'Table1ID' BOB = StringCol() is the same as class Table1(sqlobject.SQLObject): class sqlmeta: table = 'Table1' idName = 'Table1ID' _connection = conn BOB = StringCol() is the same as class Table1(sqlobject.SQLObject): _connection = conn BOB = StringCol() class sqlmeta: table = 'Table1' idName = 'Table1ID' (See - I didn't use _fromDatabase and SQLObject assumes it's False and expects you to provide a list of columns) > Is there a published list of the default naming convention that > SQLObject follows? I couldn't find it on the website. SQLObject uses "style" to convert names between Python and backend. See styles.py for existing styles. Default style is MixedCaseUnderscoreStyle but you can change it for a class (table), a group of classes or the entire program. If you don't want to override the entire style but only want to change a few names (of if your existing DB doesn't follow any style at all) - you can set the names for the table and the columns: class Table1(sqlobject.SQLObject): class sqlmeta: table = 'Table1' idName = 'Table1ID' _connection = conn BOB = StringCol(dbName='strbob') Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Chris W. <c.c...@gm...> - 2009-09-29 08:04:28
|
Dear all, I'm new to using SQLObject, and having some problems with getting it to recognise my current MySQL database. I've set up my connection fine, but it won't recognise the names of the columns (presumably because they're not written using the default naming convention?). For example, one of my columns is an acronym, so is 3 uppercase letters. I've tried the following: class Table1(sqlobject.SQLObject): _connection = conn _fromDatabase = True class sqlmeta: table = 'Table1' idName = 'Table1ID' BOB = StringCol() print Table1.get(1) this gives the result Unknown column 'bo_b' in 'field list' So, specifically a few questions: I've seen the attribute in class sqlmeta of 'columns' - will this find my column names automatically, or do I still need to input them manually? If the latter..: I assume I set the names of each column in the instance of sqlmeta (like I have done with the table name) - how do I do this?! Do I do this before or after I've told SQLObject that the BOB column is a String column? Is there a published list of the default naming convention that SQLObject follows? I couldn't find it on the website. Thanks in advance for any help anyone is able to give. Chris |
From: Daniel F. <fet...@go...> - 2009-09-21 21:52:13
|
> Hello! > > I'm pleased to announce version 0.11.1, a minor bugfix release of 0.11 > branch > of SQLObject. Hi Oleg, I actually mistakenly replied to the previous message announcing a new version in the 0.10 releases. What I have updated to was 0.11.1 and this is the version that works correctly with my application that used to be on 0.11.0. And thanks for your note on how to find the current sqlobject version. Cheers, Daniel > 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, > Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB). > > > Where is SQLObject > ================== > > Site: > http://sqlobject.org > > Development: > http://sqlobject.org/devel/ > > 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/0.11.1 > > News and changes: > http://sqlobject.org/News.html > > > What's New > ========== > > News since 0.11.0 > ----------------- > > * Fixed a bug: Sybase tables with identity column fire two identity_inserts. > > * Fixed a bug: q.startswith(), q.contains() and q.endswith() escape (with a > backslash) all special characters (backslashes, underscores and percent > signs). > > For a more complete list, please see the news: > http://sqlobject.org/News.html > > Oleg. > -- > Oleg Broytmann http://phd.pp.ru/ ph...@ph... > Programmers don't die, they just GOSUB without RETURN. > -- > http://mail.python.org/mailman/listinfo/python-list > -- Psss, psss, put it down! - http://www.cafepress.com/putitdown |
From: Oleg B. <ph...@ph...> - 2009-09-21 09:55:15
|
On Sun, Sep 20, 2009 at 06:35:53PM -0700, Daniel Fetchinson wrote: > Thanks Oleg! My application works without a problem with the new version. Thank you for the report! > By the way, am I right in saying that it is not entirely trivial to > determine which sqlobject is being used? If I import sqlobject there It was discussed a few weeks ago: >>> import sqlobject >>> sqlobject.__doc__ '\nSQLObject 0.11.1\n' > is no sqlobject.version or sqlobject.__version__ but I think this > would be a useful addition. It is in my TODO, but not at the very top. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Daniel F. <fet...@go...> - 2009-09-21 02:32:54
|
Thanks Oleg! My application works without a problem with the new version. By the way, am I right in saying that it is not entirely trivial to determine which sqlobject is being used? If I import sqlobject there is no sqlobject.version or sqlobject.__version__ but I think this would be a useful addition. Cheers, Daniel > Hello! > > I'm pleased to announce version 0.10.7, a minor bugfix release of 0.10 > branch > of SQLObject. > > > 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, > Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB). > > > Where is SQLObject > ================== > > Site: > http://sqlobject.org > > Development: > http://sqlobject.org/devel/ > > 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/0.10.7 > > News and changes: > http://sqlobject.org/News.html > > > What's New > ========== > > News since 0.10.6 > ----------------- > > * Fixed a bug: Sybase tables with identity column fire two identity_inserts. > > * Fixed a bug: q.startswith(), q.contains() and q.endswith() escape (with a > backslash) all special characters (backslashes, underscores and percent > signs). > > For a more complete list, please see the news: > http://sqlobject.org/News.html > > Oleg. > -- > Oleg Broytmann http://phd.pp.ru/ ph...@ph... > Programmers don't die, they just GOSUB without RETURN. > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss > -- Psss, psss, put it down! - http://www.cafepress.com/putitdown |
From: Oleg B. <ph...@ph...> - 2009-09-20 19:20:23
|
Hello! I'm pleased to announce version 0.11.1, a minor bugfix release of 0.11 branch of SQLObject. 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, Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB). Where is SQLObject ================== Site: http://sqlobject.org Development: http://sqlobject.org/devel/ 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/0.11.1 News and changes: http://sqlobject.org/News.html What's New ========== News since 0.11.0 ----------------- * Fixed a bug: Sybase tables with identity column fire two identity_inserts. * Fixed a bug: q.startswith(), q.contains() and q.endswith() escape (with a backslash) all special characters (backslashes, underscores and percent signs). For a more complete list, please see the news: http://sqlobject.org/News.html Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Oleg B. <ph...@ph...> - 2009-09-20 19:12:38
|
Hello! I'm pleased to announce version 0.10.7, a minor bugfix release of 0.10 branch of SQLObject. 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, Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB). Where is SQLObject ================== Site: http://sqlobject.org Development: http://sqlobject.org/devel/ 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/0.10.7 News and changes: http://sqlobject.org/News.html What's New ========== News since 0.10.6 ----------------- * Fixed a bug: Sybase tables with identity column fire two identity_inserts. * Fixed a bug: q.startswith(), q.contains() and q.endswith() escape (with a backslash) all special characters (backslashes, underscores and percent signs). For a more complete list, please see the news: http://sqlobject.org/News.html Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Oleg B. <ph...@ph...> - 2009-09-16 15:58:37
|
On Wed, Sep 16, 2009 at 05:32:06PM +0200, Frank Wagner wrote: > database didn't have a charset declared at creation time > (although it is de facto in iso-8859-1). > so this was just the first working way that i could figure out. > > i guess the UnicodeCol doesn't do it in a very different way? > > > > NAME = UnicodeCol(length=40, dbName="NAME", dbEncoding='iso-8859-1') It uses a different implementation internally based on validators/converters, but UnicodeValidator does exactly that - converts strings from DB to unicode, and converts unicode to strings for DB. See col.py. BTW, speaking about validators... > def _get_NAME(self): > return self._SO_get_NAME() and unicode(self._SO_get_NAME(), > 'iso-8859-1').strip() or u'' UnicodeCol only converts strings from/to unicode, so if you need to strip and replace None's with u'' you have to do it yourself, but the way to it, especially for many columns, is to create your own validator/converter: from col import validators class StripValidator(validators.Validator): def to_python(self, value, state): if value is None: return None # or u'' if you really want it if isinstance(value, basestring): return value.strip() raise validators.Invalid("expected a str or unicode in column '%s', got %s %r instead" % \ (self.name, type(value), value), value, state) And now you can use it in as many columns as you want: NAME = UnicodeCol(length=40, dbName="NAME", dbEncoding='iso-8859-1', validator=StripValidator(name="NAME")) SURNAME = UnicodeCol(length=40, dbName="SURNAME", dbEncoding='iso-8859-1', validator=StripValidator(name="SURNAME")) SQLObject stacks validators so your validator will be used along with UnicodeValidator in UnicodeCol, not instead of it. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Frank W. <fra...@no...> - 2009-09-16 15:32:36
|
thanks for your suggestion Oleg! I will try that instead asap. but it's been some time ago when i wrote this thing, and afair i always had a lot of problems because the (legacy) database didn't have a charset declared at creation time (although it is de facto in iso-8859-1). so this was just the first working way that i could figure out. i guess the UnicodeCol doesn't do it in a very different way? greetings, frank 2009/9/16 Oleg Broytmann <ph...@ph...> > On Wed, Sep 16, 2009 at 04:59:00PM +0200, Frank Wagner wrote: > > NAME = StringCol(length=40, dbName="NAME") > > > > def _get_NAME(self): > > return self._SO_get_NAME() and unicode(self._SO_get_NAME(), > > 'iso-8859-1').strip() or u'' > > Frank, why don't you use UnicodeCol? > > NAME = UnicodeCol(length=40, dbName="NAME", dbEncoding='iso-8859-1') > > Oleg. > -- > Oleg Broytmann http://phd.pp.ru/ ph...@ph... > Programmers don't die, they just GOSUB without RETURN. > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss > |
From: Oleg B. <ph...@ph...> - 2009-09-16 15:05:34
|
On Wed, Sep 16, 2009 at 04:59:00PM +0200, Frank Wagner wrote: > NAME = StringCol(length=40, dbName="NAME") > > def _get_NAME(self): > return self._SO_get_NAME() and unicode(self._SO_get_NAME(), > 'iso-8859-1').strip() or u'' Frank, why don't you use UnicodeCol? NAME = UnicodeCol(length=40, dbName="NAME", dbEncoding='iso-8859-1') Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Frank W. <fra...@no...> - 2009-09-16 14:59:36
|
i'm using sqlobject happily with interbase 7 via kinterbasdb.though not directly but together with the turbogears framework. connection uri is "interbase://user:pass@localhost :3050//path/to/file.IB?debug=True" it connects just fine i then define my classes as usual (already existed in database): class Teilnehmer(SQLObject): class sqlmeta: #fromDatabase=True # works more or less, but # there's trouble with string encodings idName="NR" cacheValues = True BUCHUNGSNR = IntCol(dbName="BUCHUNGSNR") NAME = StringCol(length=40, dbName="NAME") HOTELCODE = StringCol(length=8, dbName="HOTELCODE") ... finally i need some finetuning as the database doesn't have a charset defined: for each attribute/column: def _get_NAME(self): return self._SO_get_NAME() and unicode(self._SO_get_NAME(), 'iso-8859-1').strip() or u'' that's it. finally u can use all the convenient magic that comes with SQLObj. hth, frank 2009/9/16 Petr Jakeš <pet...@tp...> > Hi, > > Working on the Firebird, I just wonder if exists some way how to push > SQLObjects to configure kinterbasdb. > > I mean: I was able to use following snippet when I was working with the > database directly (using kinterbasdb). > > import kinterbasdb > kinterbasdb.init(type_conv=200) > > Is this possible using SQLObjects? > > Regards > > Petr > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss > > |
From: Oleg B. <ph...@ph...> - 2009-09-16 14:19:14
|
On Wed, Sep 16, 2009 at 04:07:12PM +0200, Petr Jake?? wrote: > Working on the Firebird, I just wonder if exists some way how to push > SQLObjects to configure kinterbasdb. > > I mean: I was able to use following snippet when I was working with the > database directly (using kinterbasdb). > > import kinterbasdb > kinterbasdb.init(type_conv=200) > > Is this possible using SQLObjects? You can use this in your program - this is module-level initialization; when SQLObject does "import kinterbasdb" it gets already initialized module. Or you can access connection.module after the connection has been initialized if it's not too late. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Petr J. <pet...@tp...> - 2009-09-16 14:07:26
|
Hi, Working on the Firebird, I just wonder if exists some way how to push SQLObjects to configure kinterbasdb. I mean: I was able to use following snippet when I was working with the database directly (using kinterbasdb). import kinterbasdb kinterbasdb.init(type_conv=200) Is this possible using SQLObjects? Regards Petr |
From: Petr J. <pet...@tp...> - 2009-09-13 09:49:28
|
2009/9/13 Alex <xk...@gm...> > How to use illegal names for MySQL with SQLObject? > In pure SQL it is possible to use backuotes, say: > SELECT `select from` FROM table1 WHERE 1; > ...can be used to select the field called `select from`. > My situation is that I already have a DB which I'm trying to connect > with SQLObject to. MySQL throws an error because the table has illegal > names. > Is it possible to tell SQLObject to utilize backquotes? > Hi, maybe you can just try to experiment with: >>> class User(SQLObject): ... ... class sqlmeta: ... # user is a reserved word in some databases, so we won't ... # use that for the table name: ... table = "user_table" ... (taken from http://www.sqlobject.org/SQLObject.html ) and with dbName class Cenktgm01(SQLObject): class sqlmeta: idType = str idName = 'OID$CENKTGM01' nazev = UnicodeCol(dbName="nazev", dbEncoding = "1250") skupina = StringCol(length = 30) You can also switch: _connection.debug = True You will see the SQL output. I have found it very useful. HTH Petr |
From: Alex <xk...@gm...> - 2009-09-13 02:20:39
|
How to use illegal names for MySQL with SQLObject? In pure SQL it is possible to use backuotes, say: SELECT `select from` FROM table1 WHERE 1; ...can be used to select the field called `select from`. My situation is that I already have a DB which I'm trying to connect with SQLObject to. MySQL throws an error because the table has illegal names. Is it possible to tell SQLObject to utilize backquotes? |
From: Oleg B. <ph...@ph...> - 2009-09-08 09:14:27
|
On Tue, Sep 08, 2009 at 10:41:20AM +0200, Sophana K wrote: > > The only place I could suspect is the call dbConnection.getConnection() > > in Transaction.__init__(). > > > I don't understand how this code works. > Why is the transaction stored into the threadlocal (in doInTransaction)? To allow different threads to assign different connections to one ConnectionHub instance. > Why doesn't the transaction stay local to the doInTransaction function? So that the transaction is propagated to all classes that use the ConnectionHub instance. > >> I forgot to say. It looks that once this happened once, all upcoming > >> transactions fail the same way. > Why do I have to restart my application to stop this? How could I guess?.. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Sophana K <sop...@gm...> - 2009-09-08 08:41:27
|
>> > >> > No, the mysql server is very loaded. > > Then how it's related to SQLObject? Timeouts between clients and the > server? > Maybe, there could be more simultaneous connections? > The only place I could suspect is the call dbConnection.getConnection() > in Transaction.__init__(). > I don't understand how this code works. Why is the transaction stored into the threadlocal (in doInTransaction)? Why doesn't the transaction stay local to the doInTransaction function? Who would retrieve this transaction and make possible collisions? Shouldn't this removed? >> I forgot to say. It looks that once this happened once, all upcoming >> transactions fail the same way. Why do I have to restart my application to stop this? >> So the __getattr__ method should be called, doesn't it? >> __getattr__ first calls self.assertActive() which checks that _obsolete is >> False. > > No, self._connection is assigned: > self._connection = dbConnection.getConnection(). After this __getattr__ is > never called on accessing the self._connection. __getattr__ is called on > accessing non-existing attributes. In the Transaction class it is used to > delegate attribute access to the underlying connection. > Ok I didn't know this. >> > What connection have you assigned to hubNoCache? It seems it's a (rolled >> > back) transaction, not a simple connection. >> > >> > >> hubNoCache=ConnectionHub() >> hubNoCache.processConnection = connectionForURI(database+'&cache=') > > Looks good, nothing strange here. Could it be an old transaction is > stuck in hubNoCache? How could this happen? Shouldn't there a piece of code that would handle this case? If the transaction is not stored into the thread, this would never happen? > I recommend you to investigate it deeper: add a lot of debugging output > to the dbconnection.py to find out what is the connection, what is the > transaction and what is the attribute that cause the problem. > I will try to add some prints. As I have made some optimizations, it doesn't seem to happen again. Thank you very much for your support. |
From: Oleg B. <ph...@ph...> - 2009-09-07 12:11:43
|
On Mon, Sep 07, 2009 at 03:58:15PM +0400, Oleg Broytmann wrote: > On Mon, Sep 07, 2009 at 01:34:51PM +0200, Tobias Weber wrote: > > I'm still not sure if SQLObject is behaving correctly, though. What's > > the point of _init if you can't access data yet? > > In this particular case _init is called in the middle of fetching > children. InheritableIteration.next() calls obj.get() which in turn calls > parent.get(), etc; every .get() calls _init, but to access all attributes > you have to wait until all .get's are finished. The same for .get() - InheritableSQLObject.get() calls super().get() which calls self._init() before self._parent.get() so _init() is called in the middle of the job - not all attributes are fetched yet. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |