sqlobject-cvs Mailing List for SQLObject (Page 71)
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: SourceForge.net <no...@so...> - 2008-03-07 15:03:14
|
Bugs item #1172892, was opened at 2005-03-30 03:24 Message generated for change (Settings changed) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1172892&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: Closed >Resolution: Wont Fix Priority: 5 Private: No Submitted By: Jonathan Ellis (ellisj) Assigned to: Nobody/Anonymous (nobody) Summary: __connection__.style broken in .6.1 Initial Comment: I created a Style subclass but it didn't work. So I changed all my Style's methods to raise an exception. Still showed default behavior. Then I tried assigning _style in each class -- that worked. I'd very much like to be able to set it globally, though. ---------------------------------------------------------------------- Comment By: Michael Abraham Shulman (viritrilbia) Date: 2005-08-18 05:21 Message: Logged In: YES user_id=54785 I have encountered this problem as well (trying to use long IDs) and I think I have figured out why it happens. When you create a table class, it is a subclass of SQLObject and hence an instance of MetaSQLObject. The __new__ method of MetaSQLObject sets _connection to __connection__ if it is unset, and then sets _style to _connection.style or styles.defaultStyle if it is unset. This sounds good, however... The trick is that SQLObject itself is an instance of MetaSQLObject, so when sqlobject is *loaded*, SQLObject._style gets set to styles.defaultStyle. Nothing can be done about this, since you haven't had a chance to set __connection__ yet, let alone __connection__.style. Then when you create table classes, since they are subclasses of SQLObject, they inherit its _style attribute, so MetaSQLObject.__new__ doesn't even look at _connection.style. An even easier version of the workaround below, as long as you are only using one style in your entire program, is to set SQLObject._style to your desired style. This obviates the need for an extra base class. I think it would be best if style could be set by connection, since the style used is really a property of the database in question. I'm not sure how one would accomplish this, however, if the above is indeed the problem. Maybe MetaSQLObject.__new__ should decline to set _style if it is not setting _connection as well? ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-03-30 18:20 Message: Logged In: NO That is a nice workaround, but either dbconnection.style should work or it should be removed... ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2005-03-30 16:08 Message: Logged In: YES user_id=4799 Create a class that will be served as the base class for all your tables. Assign your style to it: class Base(SQLObject): _style = MyStyle() class MyTable(Base): ... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1172892&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-07 14:59:15
|
Bugs item #1158024, was opened at 2005-03-07 04:49 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1158024&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: SQLite Group: SQLObject from repository >Status: Closed >Resolution: Works For Me Priority: 5 Private: No Submitted By: Leandro Lucarella (llucax) Assigned to: Oleg Broytmann (phd) Summary: BoolCol() is allways True with BOOL or BOOLEAN column Initial Comment: I don't know if this is a bug or a feature, but is at least odd. If the type of the column in a DB is BOOL or BOOLEAN (or CHAR or other more weird types), and you use a BoolCol() SQLObject column to represent it, the value is allways True (I guess is using '0' as a string and it evaluates to True). If the column is TINYINT or INT, it works ok. Small testcase attached. ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-03-07 17:59 Message: Logged In: YES user_id=4799 Originator: NO I ran the test (slightly modified) with SQLOBject 0.9.4: print 'Expected:', False b = BoolTest(tinyint=False, integer=False, bool=False, boolean=False) print 'Got: tinyint =', b.tinyint, '| integer =', b.integer, '| bool =', b.bool, '| boolean = ', b.boolean print 'Expected:', True b = BoolTest(tinyint=True, integer=True, bool=True, boolean=True) print 'Got: tinyint =', b.tinyint, '| integer =', b.integer, '| bool =', b.bool, '| boolean = ', b.boolean Output: 1/Query : CREATE TABLE bool_test ( id INTEGER PRIMARY KEY, tinyint TINYINT, integer INTEGER, bool BOOL, boolean BOOLEAN ) 1/QueryR : CREATE TABLE bool_test ( id INTEGER PRIMARY KEY, tinyint TINYINT, integer INTEGER, bool BOOL, boolean BOOLEAN ) Expected: False 2/QueryIns: INSERT INTO bool_test (integer, tinyint, boolean, bool) VALUES (0, 0, 0, 0) 2/QueryR : INSERT INTO bool_test (integer, tinyint, boolean, bool) VALUES (0, 0, 0, 0) 3/QueryOne: SELECT tinyint, integer, bool, boolean FROM bool_test WHERE ((bool_test.id) = (1)) 3/QueryR : SELECT tinyint, integer, bool, boolean FROM bool_test WHERE ((bool_test.id) = (1)) Got: tinyint = False | integer = False | bool = False | boolean = False Expected: True 4/QueryIns: INSERT INTO bool_test (integer, tinyint, boolean, bool) VALUES (1, 1, 1, 1) 4/QueryR : INSERT INTO bool_test (integer, tinyint, boolean, bool) VALUES (1, 1, 1, 1) 5/QueryOne: SELECT tinyint, integer, bool, boolean FROM bool_test WHERE ((bool_test.id) = (2)) 5/QueryR : SELECT tinyint, integer, bool, boolean FROM bool_test WHERE ((bool_test.id) = (2)) Got: tinyint = True | integer = True | bool = True | boolean = True ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2005-04-06 07:53 Message: Logged In: YES user_id=4799 SQLObject should not be expected to compensate for user errors. If you use PyGreSQL, of if you use CHAR instead of INTEGER/TINYINT for boolean columns - why do SQLObject should fix it? PS. See http://sqlobject.org/ for details on the mailing list. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2005-04-06 06:12 Message: Logged In: YES user_id=240225 Ugh? I'm not talking about the connection object, I'm talking about SQLObject. I thought one of the goals of SQLObject was to unify this behavoir. So if tomorrow I want to change from SQLite to PostgreSQL I don't have to change all my test for BoolCol()s from True/False to 't'/'f'. Do you mean that if I have: class C(SQLObject): b = BoolCol() c = C.get(1) print c.b will print True/False (or 1/0) in SQLite and 't'/'f' in PostgreSQL? PS: Is there any IRC channel or other way to talk in a more interactive way? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2005-04-05 19:26 Message: Logged In: YES user_id=4799 The following script: ---------- import pg db = pg.connect("test") q = db.query("CREATE TABLE test (b boolean)") q = db.query("INSERT INTO test VALUES ('f')") q = db.query("INSERT INTO test VALUES ('t')") q = db.query("INSERT INTO test VALUES ('1')") q = db.query("SELECT * FROM test") r = q.getresult() print r[0][0] print type(r[0][0]) ---------- prints: ---------- f <type 'str'> ---------- Yes, PyGreSQL is not the most used driver. SQLObject is mostly oriented toward psycopg, but still PyGreSQL can be used instead. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2005-04-05 19:04 Message: Logged In: YES user_id=240225 But this is never mapped to a Python bool() type? ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2005-04-05 18:38 Message: Logged In: YES user_id=4799 For boolean columns Postgres (PyGreSQL) returns strings 'f' and 't'. You cannot pass them to int(). ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2005-03-30 17:09 Message: Logged In: YES user_id=240225 It won't hurt MySQL or Postgres. If Postgres return a bool(), when converted to int() and evaluated as bool() again, it remains the same, same for MySQL int(). I think is harmless for other DB engines. The problem is I'm using the DB in other programs too, not just SQLObject. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2005-03-30 16:00 Message: Logged In: YES user_id=4799 The patch is meaningful only for SQLite. What about Postgres? MySQL? When you create a DB by hand create it according SQLObject rules. The boolean columns in SQLite must be TINYINT. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2005-03-30 06:39 Message: Logged In: YES user_id=240225 Here's a small workarround that converts to python type int() before evaluating to True or False in BoolValidator.toPython(). ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2005-03-30 06:27 Message: Logged In: YES user_id=240225 I don't. I have the column created as a BOOL type. Since SQLite is typeless its seems to be mapped to simple string by... pysqlite? I'm creating the database by hand. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2005-03-30 00:03 Message: Logged In: YES user_id=4799 Why do you have a string in the BoolCol? SOBoolCol declares def _sqliteType(self): return "TINYINT" ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2005-03-29 23:36 Message: Logged In: YES user_id=240225 There's no way to make SQLite to convert BoolCol() the (possible) string() value to int() before evaluate them as bool()? Or this is an PySQLite issue? If so, is there any way to use PySQLite type mapping to fixe it? I just couldn't find where to do it but if you give me a clue I can try to fix it my self... ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2005-03-29 20:19 Message: Logged In: YES user_id=4799 MySQL maps BOOL to TINYINT, which is much more correct mapping. Postgres has a special BOOLEAN column type. SQLite does not have BOOL/BOOLEAN type. I don't know to what type it's silently mapped. Probably, CHAR. SQLite is a bad citizen here. Use INT/TINYINT instead. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1158024&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-07 14:50:56
|
Bugs item #1073535, was opened at 2004-11-26 07:33 Message generated for change (Settings changed) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1073535&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: Closed >Resolution: Wont Fix Priority: 4 Private: No Submitted By: Justin A (justin_a) Assigned to: Nobody/Anonymous (nobody) Summary: sqlbuilder funcs get cached instead of their value Initial Comment: when caching is enabled and you do foo.bardate=sqlbuilder.func.now() it updates the db correctly, but foo.bardate then has the value of the sqlbuilder function: ---------------------------------------------------------------------- Comment By: Ian Bicking (ianbicking) Date: 2005-09-20 20:06 Message: Logged In: YES user_id=210337 As a workaround, if you call obj.sync() or obj.expire() after setting one of its attributes to a sqlbuilder object, it will refetch the data (immediately or lazily, respectively) and get rid of that bad value. In this particular case, it is best to use datetime.now (e.g., default=datetime.now). However, I'm not closing this, as SQLObject should detect these objects and call obj.expire() on its own. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2005-03-01 19:12 Message: Logged In: YES user_id=4799 That breaks the rule "do a least unexpected thing". Running SELECT upon an assignment is certainly a very unexpected beahviour. Even running SELECT upon reading such attribute is a bit strange. Currently one can overcome that by setting cacheValues to False. Well, I must admit the solution solves too much - it forces a SELECT for accessing ANY attribute. Well, I can be wrong. Can you bring the subject to the mailing list? Public discussions about controversial subjects are better than SF tracker. ---------------------------------------------------------------------- Comment By: Justin A (justin_a) Date: 2005-03-01 18:46 Message: Logged In: YES user_id=547833 I would think it should run SELECT on any assignment to a function... ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2005-03-01 18:08 Message: Logged In: YES user_id=4799 Ok, now look. You ran the query UPDATE dates SET dateb = NOW() WHERE id = 2 How should SQLObject know the value of NOW() on the server? Should it run SELECT? Really, should it run SELECT on the attribute assignment?! on any attribute assignment? ---------------------------------------------------------------------- Comment By: Justin A (justin_a) Date: 2004-11-26 07:34 Message: Logged In: YES user_id=547833 This is with sqlobject 0.6. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1073535&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-07 14:48:38
|
Bugs item #1040526, was opened at 2004-10-05 13:51 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1040526&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: SQLObject from repository >Status: Closed >Resolution: Wont Fix Priority: 5 Private: No Submitted By: Marcin Wojdyr (wojdyr) >Assigned to: Oleg Broytmann (phd) Summary: too many DB selects in person.addresses case Initial Comment: I see the same number of queries as Robert Marcin http://sourceforge.net/mailarchive/message.php?msg_id=9673722 >> First about MultipleJoin: as Robert wrote in >> http://sourceforge.net/mailarchive/forum.php?thread_id=5435228&forum_id=30269 >> >> person.addresses will generate n+1 queries to DB. > > > I don"t think that is what happens...? It"s certainly not intended to > cause that many selects. Unfortunately, it does, at least it does when using Postgres, a fresh install of SQLObject 0.6, Python 2.3.3, W2000 :-( The first select is : SELECT id FROM address WHERE person_id = ### which returns "n" id"s then for every id in the returned list there is : SELECT column(s)... FROM address WHERE id = #### i.e. n+1 queries to DB. Robert ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-03-07 17:48 Message: Logged In: YES user_id=4799 Originator: NO Use SQLMultipleJoin. ---------------------------------------------------------------------- Comment By: Garrett Smith (garrett1020) Date: 2006-02-05 07:29 Message: Logged In: YES user_id=448609 Based on the code, this behavior appears very much by design. I recommend turning MultipleJoin into a descriptor that implements a standard select, which would avoid the multiple calls to the DB. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1040526&group_id=74338 |
|
From: SourceForge.net <no...@so...> - 2008-03-07 14:47:07
|
Bugs item #1012374, was opened at 2004-08-19 22:08 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1012374&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 from repository >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Andrew Bennetts (spiv) >Assigned to: Oleg Broytmann (phd) Summary: Cannot use DEFAULT values defined in SQL. Initial Comment: Given a table with a column like: CREATE TABLE Foo ( datecreated timestamp NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC'), .... ) There is no way to utilise that default value when constructing a Foo. e.g., if that is the only column in Foo, it should be possible in Python to do: f1 = Foo() But even though the default value for the DateTimeCol's default argument is NoDefault, SQLObject still insists that an argument is passed to Foo's constructor. For backwards compatibility, probably what should be done is define a new magic value, e.g. 'NoDefaultRequired', so that the Foo class could be defined as: class Foo(SQLObject): datecreated = DateTimeCol(notNull=True, default=NoDefaultRequired) ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-03-07 17:47 Message: Logged In: YES user_id=4799 Originator: NO Starting with SQLObject 0.9.4 one can define defaultSQL for a column and do not pass a value to the constructor. ---------------------------------------------------------------------- Comment By: Viktor Ferenczi (complex) Date: 2005-03-13 05:58 Message: Logged In: YES user_id=142612 Do you generate your table class from the SQL database? (See "Automatic Class Generation" in the SQLObject manual.) I don't know that such a complex default value could be imported by SQLObject from the SQL database schema, but it's technically possible. If you don't use automatic class generation, then try to define a default value in your python class, such as: from sqlobject import * class Foo(SQLObject): dt=DateTimeCol(default=func.NOW()) foo=Foo() print foo.dt This does not work with PySQLite, but you can use datetime.datetime.today() instead. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1012374&group_id=74338 |
|
From: <sub...@co...> - 2008-03-07 13:38:36
|
Author: phd Date: 2008-03-07 06:38:30 -0700 (Fri, 07 Mar 2008) New Revision: 3303 Modified: SQLObject/trunk/docs/community.txt Log: HTTP and blog-like access to GMane. Modified: SQLObject/trunk/docs/community.txt =================================================================== --- SQLObject/trunk/docs/community.txt 2008-03-07 13:36:33 UTC (rev 3302) +++ SQLObject/trunk/docs/community.txt 2008-03-07 13:38:30 UTC (rev 3303) @@ -7,8 +7,10 @@ You may want to view the `searchable archives <http://pythonpaste.org/archives/list/sqlobject-discuss.en.html>`_. `Gmane <http://www.gmane.org/>`_ also has the list in -`gmane.comp.python.sqlobject -<news://news.gmane.org/gmane.comp.python.sqlobject>`_. +gmane.comp.python.sqlobject accessible by +`HTTP <http://news.gmane.org/gmane.comp.python.sqlobject>`_, +`HTTP (blog format) <http://blog.gmane.org/gmane.comp.python.sqlobject>`_ +and `News <news://news.gmane.org/gmane.comp.python.sqlobject>`_. Bugs should be submitted to the `bug tracker <http://sourceforge.net/tracker/?group_id=74338&atid=540672>`_, and |
|
From: <sub...@co...> - 2008-03-07 13:36:37
|
Author: phd Date: 2008-03-07 06:36:33 -0700 (Fri, 07 Mar 2008) New Revision: 3302 Modified: SQLObject/branches/0.10/docs/community.txt Log: HTTP and blog-like access to GMane. Modified: SQLObject/branches/0.10/docs/community.txt =================================================================== --- SQLObject/branches/0.10/docs/community.txt 2008-03-07 13:35:48 UTC (rev 3301) +++ SQLObject/branches/0.10/docs/community.txt 2008-03-07 13:36:33 UTC (rev 3302) @@ -7,8 +7,10 @@ You may want to view the `searchable archives <http://pythonpaste.org/archives/list/sqlobject-discuss.en.html>`_. `Gmane <http://www.gmane.org/>`_ also has the list in -`gmane.comp.python.sqlobject -<news://news.gmane.org/gmane.comp.python.sqlobject>`_. +gmane.comp.python.sqlobject accessible by +`HTTP <http://news.gmane.org/gmane.comp.python.sqlobject>`_, +`HTTP (blog format) <http://blog.gmane.org/gmane.comp.python.sqlobject>`_ +and `News <news://news.gmane.org/gmane.comp.python.sqlobject>`_. Bugs should be submitted to the `bug tracker <http://sourceforge.net/tracker/?group_id=74338&atid=540672>`_, and |
|
From: <sub...@co...> - 2008-03-07 13:35:57
|
Author: phd Date: 2008-03-07 06:35:48 -0700 (Fri, 07 Mar 2008) New Revision: 3301 Modified: SQLObject/branches/0.9/docs/community.txt Log: HTTP and blog-like access to GMane. Modified: SQLObject/branches/0.9/docs/community.txt =================================================================== --- SQLObject/branches/0.9/docs/community.txt 2008-03-06 09:53:15 UTC (rev 3300) +++ SQLObject/branches/0.9/docs/community.txt 2008-03-07 13:35:48 UTC (rev 3301) @@ -7,8 +7,10 @@ You may want to view the `searchable archives <http://pythonpaste.org/archives/list/sqlobject-discuss.en.html>`_. `Gmane <http://www.gmane.org/>`_ also has the list in -`gmane.comp.python.sqlobject -<news://news.gmane.org/gmane.comp.python.sqlobject>`_. +gmane.comp.python.sqlobject accessible by +`HTTP <http://news.gmane.org/gmane.comp.python.sqlobject>`_, +`HTTP (blog format) <http://blog.gmane.org/gmane.comp.python.sqlobject>`_ +and `News <news://news.gmane.org/gmane.comp.python.sqlobject>`_. Bugs should be submitted to the `bug tracker <http://sourceforge.net/tracker/?group_id=74338&atid=540672>`_, and |
|
From: <sub...@co...> - 2008-03-06 09:53:20
|
Author: phd Date: 2008-03-06 02:53:15 -0700 (Thu, 06 Mar 2008) New Revision: 3300 Modified: SQLObject/trunk/docs/News.txt Log: SQLObject 0.9.4 was released 3 Mar 2008. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2008-03-06 09:52:48 UTC (rev 3299) +++ SQLObject/trunk/docs/News.txt 2008-03-06 09:53:15 UTC (rev 3300) @@ -86,6 +86,8 @@ SQLObject 0.9.4 =============== +Released 3 Mar 2008. + * Use list.reverse() in manager/command.py for Python 2.2 compatibility. * Prevent MultipleJoin from removing the intermediate table if it was not |
|
From: <sub...@co...> - 2008-03-06 09:52:55
|
Author: phd Date: 2008-03-06 02:52:48 -0700 (Thu, 06 Mar 2008) New Revision: 3299 Modified: SQLObject/branches/0.10/docs/News.txt Log: SQLObject 0.9.4 was released 3 Mar 2008. Modified: SQLObject/branches/0.10/docs/News.txt =================================================================== --- SQLObject/branches/0.10/docs/News.txt 2008-03-06 09:52:05 UTC (rev 3298) +++ SQLObject/branches/0.10/docs/News.txt 2008-03-06 09:52:48 UTC (rev 3299) @@ -78,6 +78,8 @@ SQLObject 0.9.4 =============== +Released 3 Mar 2008. + * Use list.reverse() in manager/command.py for Python 2.2 compatibility. * Prevent MultipleJoin from removing the intermediate table if it was not |
|
From: <sub...@co...> - 2008-03-06 09:52:14
|
Author: phd Date: 2008-03-06 02:52:05 -0700 (Thu, 06 Mar 2008) New Revision: 3298 Modified: SQLObject/branches/0.9/docs/News.txt Log: SQLObject 0.9.4 was released 3 Mar 2008. Modified: SQLObject/branches/0.9/docs/News.txt =================================================================== --- SQLObject/branches/0.9/docs/News.txt 2008-03-05 01:39:13 UTC (rev 3297) +++ SQLObject/branches/0.9/docs/News.txt 2008-03-06 09:52:05 UTC (rev 3298) @@ -10,6 +10,8 @@ SQLObject 0.9.4 =============== +Released 3 Mar 2008. + * Use list.reverse() in manager/command.py for Python 2.2 compatibility. * Prevent MultipleJoin from removing the intermediate table if it was not |
|
From: <sub...@co...> - 2008-03-03 16:57:30
|
Author: phd Date: 2008-03-03 09:57:24 -0700 (Mon, 03 Mar 2008) New Revision: 3293 Modified: SQLObject/branches/0.10/docs/News.txt Log: tablesUsedSet Modified: SQLObject/branches/0.10/docs/News.txt =================================================================== --- SQLObject/branches/0.10/docs/News.txt 2008-03-03 16:52:47 UTC (rev 3292) +++ SQLObject/branches/0.10/docs/News.txt 2008-03-03 16:57:24 UTC (rev 3293) @@ -73,7 +73,7 @@ * Use sets instead of dicts in tablesUsed. Dropped tablesUsedDict function; instead there is tablesUsedSet that returns a set of strings. -* SQLBuilder tablesUsedDict handles sqlrepr'able objects. +* SQLBuilder tablesUsedSet handles sqlrepr'able objects. SQLObject 0.9.4 =============== |
|
From: <sub...@co...> - 2008-03-03 16:52:55
|
Author: phd Date: 2008-03-03 09:52:47 -0700 (Mon, 03 Mar 2008) New Revision: 3292 Modified: SQLObject/tags/0.10.0b4/setup.cfg SQLObject/tags/0.10.0b4/setup.py SQLObject/tags/0.10.0b4/sqlobject/__init__.py SQLObject/tags/0.10.0b4/sqlobject/main.py Log: Version 0.10.0b4. Modified: SQLObject/tags/0.10.0b4/setup.cfg =================================================================== --- SQLObject/tags/0.10.0b4/setup.cfg 2008-03-03 16:51:19 UTC (rev 3291) +++ SQLObject/tags/0.10.0b4/setup.cfg 2008-03-03 16:52:47 UTC (rev 3292) @@ -5,10 +5,6 @@ [easy_install] #find_links = http://svn.pythonpaste.org/package_index.html -[egg_info] -tag_build = dev -tag_svn_revision = true - [pudge] theme = pythonpaste.org docs = docs/index.txt docs/Authors.txt docs/DeveloperGuide.txt docs/FAQ.txt Modified: SQLObject/tags/0.10.0b4/setup.py =================================================================== --- SQLObject/tags/0.10.0b4/setup.py 2008-03-03 16:51:19 UTC (rev 3291) +++ SQLObject/tags/0.10.0b4/setup.py 2008-03-03 16:52:47 UTC (rev 3292) @@ -21,7 +21,7 @@ """ setup(name="SQLObject", - version="0.10", + version="0.10.0b4", description="Object-Relational Manager, aka database wrapper", long_description="""\ SQLObject is a popular *Object Relational Manager* for providing an @@ -49,7 +49,7 @@ author="Ian Bicking", author_email="ia...@co...", url="http://sqlobject.org/devel/", - download_url="http://cheeseshop.python.org/pypi/SQLObject/0.10", + download_url="http://cheeseshop.python.org/pypi/SQLObject/0.10.0b4", license="LGPL", packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], scripts=["scripts/sqlobject-admin"], Modified: SQLObject/tags/0.10.0b4/sqlobject/__init__.py =================================================================== --- SQLObject/tags/0.10.0b4/sqlobject/__init__.py 2008-03-03 16:51:19 UTC (rev 3291) +++ SQLObject/tags/0.10.0b4/sqlobject/__init__.py 2008-03-03 16:52:47 UTC (rev 3292) @@ -1,5 +1,5 @@ """ -SQLObject 0.10 +SQLObject 0.10.0b4 """ from main import * Modified: SQLObject/tags/0.10.0b4/sqlobject/main.py =================================================================== --- SQLObject/tags/0.10.0b4/sqlobject/main.py 2008-03-03 16:51:19 UTC (rev 3291) +++ SQLObject/tags/0.10.0b4/sqlobject/main.py 2008-03-03 16:52:47 UTC (rev 3292) @@ -1,6 +1,6 @@ """ -SQLObject 0.10 --------------- +SQLObject 0.10.0b4 +------------------ :author: Ian Bicking <ia...@co...> |
|
From: <sub...@co...> - 2008-03-03 16:51:27
|
Author: phd Date: 2008-03-03 09:51:19 -0700 (Mon, 03 Mar 2008) New Revision: 3291 Added: SQLObject/tags/0.10.0b4/ Log: Tagging 0.10.0b4 Copied: SQLObject/tags/0.10.0b4 (from rev 3290, SQLObject/branches/0.10) |
|
From: <sub...@co...> - 2008-03-03 16:41:59
|
Author: phd Date: 2008-03-03 09:41:54 -0700 (Mon, 03 Mar 2008) New Revision: 3290 Modified: SQLObject/tags/0.9.4/setup.cfg SQLObject/tags/0.9.4/setup.py SQLObject/tags/0.9.4/sqlobject/__init__.py SQLObject/tags/0.9.4/sqlobject/main.py Log: Version 0.9.4. Modified: SQLObject/tags/0.9.4/setup.cfg =================================================================== --- SQLObject/tags/0.9.4/setup.cfg 2008-03-03 16:38:51 UTC (rev 3289) +++ SQLObject/tags/0.9.4/setup.cfg 2008-03-03 16:41:54 UTC (rev 3290) @@ -5,10 +5,6 @@ [easy_install] #find_links = http://svn.pythonpaste.org/package_index.html -[egg_info] -tag_build = dev -tag_svn_revision = true - [pudge] theme = pythonpaste.org docs = docs/index.txt docs/SQLObject.txt docs/TODO.txt Modified: SQLObject/tags/0.9.4/setup.py =================================================================== --- SQLObject/tags/0.9.4/setup.py 2008-03-03 16:38:51 UTC (rev 3289) +++ SQLObject/tags/0.9.4/setup.py 2008-03-03 16:41:54 UTC (rev 3290) @@ -28,7 +28,7 @@ """ setup(name="SQLObject", - version="0.9", + version="0.9.4", description="Object-Relational Manager, aka database wrapper", long_description="""\ SQLObject is a popular *Object Relational Manager* for providing an @@ -56,7 +56,7 @@ author="Ian Bicking", author_email="ia...@co...", url="http://sqlobject.org/devel/", - download_url="http://cheeseshop.python.org/pypi/SQLObject/0.9", + download_url="http://cheeseshop.python.org/pypi/SQLObject/0.9.4", license="LGPL", packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], scripts=["scripts/sqlobject-admin"], Modified: SQLObject/tags/0.9.4/sqlobject/__init__.py =================================================================== --- SQLObject/tags/0.9.4/sqlobject/__init__.py 2008-03-03 16:38:51 UTC (rev 3289) +++ SQLObject/tags/0.9.4/sqlobject/__init__.py 2008-03-03 16:41:54 UTC (rev 3290) @@ -1,5 +1,5 @@ """ -SQLObject 0.9 +SQLObject 0.9.4 """ from main import * Modified: SQLObject/tags/0.9.4/sqlobject/main.py =================================================================== --- SQLObject/tags/0.9.4/sqlobject/main.py 2008-03-03 16:38:51 UTC (rev 3289) +++ SQLObject/tags/0.9.4/sqlobject/main.py 2008-03-03 16:41:54 UTC (rev 3290) @@ -1,6 +1,6 @@ """ -SQLObject 0.9 -------------- +SQLObject 0.9.4 +--------------- :author: Ian Bicking <ia...@co...> |
|
From: <sub...@co...> - 2008-03-03 16:38:58
|
Author: phd Date: 2008-03-03 09:38:51 -0700 (Mon, 03 Mar 2008) New Revision: 3289 Added: SQLObject/tags/0.9.4/ Log: Tagging 0.9.4 Copied: SQLObject/tags/0.9.4 (from rev 3288, SQLObject/branches/0.9) |
|
From: <sub...@co...> - 2008-03-03 16:37:15
|
Author: phd
Date: 2008-03-03 09:37:08 -0700 (Mon, 03 Mar 2008)
New Revision: 3288
Modified:
SQLObject/trunk/sqlobject/col.py
SQLObject/trunk/sqlobject/converters.py
SQLObject/trunk/sqlobject/tests/test_decimal.py
Log:
Decimal module is always available in Python 2.4+.
Modified: SQLObject/trunk/sqlobject/col.py
===================================================================
--- SQLObject/trunk/sqlobject/col.py 2008-03-03 16:35:42 UTC (rev 3287)
+++ SQLObject/trunk/sqlobject/col.py 2008-03-03 16:37:08 UTC (rev 3288)
@@ -1271,10 +1271,7 @@
baseClass = SOTimestampCol
-try:
- from decimal import Decimal
-except ImportError:
- Decimal = float
+from decimal import Decimal
class DecimalValidator(validators.Validator):
def to_python(self, value, state):
Modified: SQLObject/trunk/sqlobject/converters.py
===================================================================
--- SQLObject/trunk/sqlobject/converters.py 2008-03-03 16:35:42 UTC (rev 3287)
+++ SQLObject/trunk/sqlobject/converters.py 2008-03-03 16:37:08 UTC (rev 3288)
@@ -23,13 +23,10 @@
except ImportError:
NumericType = None
+from decimal import Decimal
+from sets import Set, ImmutableSet
from types import ClassType, InstanceType, NoneType
-try:
- from decimal import Decimal
-except ImportError:
- Decimal = None
-
########################################
## Quoting
########################################
@@ -156,7 +153,6 @@
registerConverter(dict, SequenceConverter)
registerConverter(set, SequenceConverter)
registerConverter(frozenset, SequenceConverter)
-from sets import Set, ImmutableSet
registerConverter(Set, SequenceConverter)
registerConverter(ImmutableSet, SequenceConverter)
@@ -183,11 +179,10 @@
registerConverter(datetime.time, TimeConverter)
-if Decimal:
- def DecimalConverter(value, db):
- return value.to_eng_string()
+def DecimalConverter(value, db):
+ return value.to_eng_string()
- registerConverter(Decimal, DecimalConverter)
+registerConverter(Decimal, DecimalConverter)
def sqlrepr(obj, db=None):
try:
Modified: SQLObject/trunk/sqlobject/tests/test_decimal.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_decimal.py 2008-03-03 16:35:42 UTC (rev 3287)
+++ SQLObject/trunk/sqlobject/tests/test_decimal.py 2008-03-03 16:37:08 UTC (rev 3288)
@@ -1,11 +1,7 @@
+from decimal import Decimal
from sqlobject import *
from sqlobject.tests.dbtest import *
-try:
- from decimal import Decimal
-except ImportError:
- Decimal = None
-
########################################
## Decimal columns
########################################
@@ -19,17 +15,16 @@
setupClass(DecimalTable)
d = DecimalTable(col1=21.12)
# psycopg2 returns float as Decimal
- if Decimal and isinstance(d.col1, Decimal):
+ if isinstance(d.col1, Decimal):
assert d.col1 == Decimal("21.12")
else:
assert d.col1 == 21.12
- if Decimal:
- def test_2Decimal():
- """Tests new instance with a Decimal in col1."""
- setupClass(DecimalTable)
- d = DecimalTable(col1=Decimal("21.12"))
- if isinstance(d.col1, Decimal):
- assert d.col1 == Decimal("21.12")
- else:
- assert d.col1 == 21.12
+ def test_2Decimal():
+ """Tests new instance with a Decimal in col1."""
+ setupClass(DecimalTable)
+ d = DecimalTable(col1=Decimal("21.12"))
+ if isinstance(d.col1, Decimal):
+ assert d.col1 == Decimal("21.12")
+ else:
+ assert d.col1 == 21.12
|
|
From: <sub...@co...> - 2008-03-03 16:35:49
|
Author: phd Date: 2008-03-03 09:35:42 -0700 (Mon, 03 Mar 2008) New Revision: 3287 Modified: SQLObject/trunk/docs/News.txt Log: Minor doc update. Modified: SQLObject/trunk/docs/News.txt =================================================================== --- SQLObject/trunk/docs/News.txt 2008-03-03 16:34:53 UTC (rev 3286) +++ SQLObject/trunk/docs/News.txt 2008-03-03 16:35:42 UTC (rev 3287) @@ -86,6 +86,8 @@ SQLObject 0.9.4 =============== +* Use list.reverse() in manager/command.py for Python 2.2 compatibility. + * Prevent MultipleJoin from removing the intermediate table if it was not created by the Join. |
|
From: <sub...@co...> - 2008-03-03 16:34:59
|
Author: phd Date: 2008-03-03 09:34:53 -0700 (Mon, 03 Mar 2008) New Revision: 3286 Modified: SQLObject/branches/0.10/docs/News.txt Log: Minor doc update. Modified: SQLObject/branches/0.10/docs/News.txt =================================================================== --- SQLObject/branches/0.10/docs/News.txt 2008-03-03 16:34:21 UTC (rev 3285) +++ SQLObject/branches/0.10/docs/News.txt 2008-03-03 16:34:53 UTC (rev 3286) @@ -78,7 +78,7 @@ SQLObject 0.9.4 =============== -* Use list.reverse() in manager/command.py for Python 2.3 compatibility. +* Use list.reverse() in manager/command.py for Python 2.2 compatibility. * Prevent MultipleJoin from removing the intermediate table if it was not created by the Join. |
|
From: <sub...@co...> - 2008-03-03 16:34:30
|
Author: phd Date: 2008-03-03 09:34:21 -0700 (Mon, 03 Mar 2008) New Revision: 3285 Modified: SQLObject/branches/0.9/docs/News.txt Log: Minor doc update. Modified: SQLObject/branches/0.9/docs/News.txt =================================================================== --- SQLObject/branches/0.9/docs/News.txt 2008-03-03 16:25:18 UTC (rev 3284) +++ SQLObject/branches/0.9/docs/News.txt 2008-03-03 16:34:21 UTC (rev 3285) @@ -10,7 +10,7 @@ SQLObject 0.9.4 =============== -* Use list.reverse() in manager/command.py for Python 2.3 compatibility. +* Use list.reverse() in manager/command.py for Python 2.2 compatibility. * Prevent MultipleJoin from removing the intermediate table if it was not created by the Join. |
|
From: SourceForge.net <no...@so...> - 2008-03-03 16:32:36
|
Patches item #1673015, was opened at 2007-03-03 11:26 Message generated for change (Comment added) made by llucax You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1673015&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: Closed Resolution: Accepted Priority: 5 Private: No Submitted By: Leandro Lucarella (llucax) Assigned to: Oleg Broytmann (phd) Summary: Use sets instead of dicts for used tables. Initial Comment: Since dicts are used as plain sets there, why not to just use sets? Yeah, I know, because of Python 2.2 compatibility :) Maybe some day... ---------------------------------------------------------------------- >Comment By: Leandro Lucarella (llucax) Date: 2008-03-03 13:32 Message: Logged In: YES user_id=240225 Originator: YES ups! Sorry again, I'm at work and didn't had the time to test it. Maybe I should waited to get home and do it right then =/ Thanks. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2008-03-03 13:10 Message: Logged In: YES user_id=4799 Originator: NO There were these small problems: 1. E if t1 in tables: tables.remoce(t1) > AttributeError: 'set' object has no attribute 'remoce' [sqlobject/sqlbuilder.py:635] 2. E assert tablesUsedDict(x, None).keys() == ['not_yet_imported4 y'] > NameError: global name 'tablesUsedDict' is not defined [sqlobject/tests/test_sqlbuilder_importproxy.py:50] 3. E return d > NameError: global name 'd' is not defined [sqlobject/inheritance/__init__.py:21] I fixed them myself. Committed in the revisions 3281-3282 (0.10 and the trunk). Thank you! ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2008-03-03 12:15 Message: Logged In: YES user_id=240225 Originator: YES Sure, sorry about that... File Added: tablesdict.str.set-0.10.patch ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2008-03-03 12:04 Message: Logged In: YES user_id=4799 Originator: NO Thank you. There is also a tables dict in the method Select.__sqlrepr__(). Can you update it, too? (sqlbuilder.py, lines 622-632). ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2008-03-03 11:10 Message: Logged In: YES user_id=240225 Originator: YES Patch agains 0.10 attached. File Added: tablesdict.str.set-0.10.patch ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2008-03-03 10:19 Message: Logged In: YES user_id=4799 Originator: NO Please recreate the patch against the 0.10 branch: tablesUsedDict() has an additional parameter 'db'. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-03-27 11:21 Message: Logged In: YES user_id=4799 Originator: NO Will be applied after SQLObject would have switched to Python 2.3. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-03-03 11:27 Message: Logged In: YES user_id=240225 Originator: YES File Added: tablesdict.str.set-trunk.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1673015&group_id=74338 |
|
From: <sub...@co...> - 2008-03-03 16:25:25
|
Author: phd
Date: 2008-03-03 09:25:18 -0700 (Mon, 03 Mar 2008)
New Revision: 3284
Modified:
SQLObject/trunk/setup.py
SQLObject/trunk/sqlobject/dbconnection.py
SQLObject/trunk/sqlobject/events.py
SQLObject/trunk/sqlobject/main.py
SQLObject/trunk/sqlobject/versioning/test/test_version.py
Log:
Dropped support for Python 2.3.
Modified: SQLObject/trunk/setup.py
===================================================================
--- SQLObject/trunk/setup.py 2008-03-03 16:24:15 UTC (rev 3283)
+++ SQLObject/trunk/setup.py 2008-03-03 16:25:18 UTC (rev 3284)
@@ -13,13 +13,6 @@
'manager', 'maxdb', 'mysql', 'mssql', 'postgres', 'sqlite',
'sybase', 'util', 'versioning']
-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
-
kw = {}
if is_setuptools:
kw['entry_points'] = """
Modified: SQLObject/trunk/sqlobject/dbconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/dbconnection.py 2008-03-03 16:24:15 UTC (rev 3283)
+++ SQLObject/trunk/sqlobject/dbconnection.py 2008-03-03 16:25:18 UTC (rev 3284)
@@ -115,8 +115,7 @@
else:
host, rest = rest.split('/', 1)
if host and host.find('@') != -1:
- user = host[:host.rfind('@')] # Python 2.3 doesn't have .rsplit()
- host = host[host.rfind('@')+1:] # !!!
+ user, host = host.rsplit('@', 1)
if user.find(':') != -1:
user, password = user.split(':', 1)
else:
Modified: SQLObject/trunk/sqlobject/events.py
===================================================================
--- SQLObject/trunk/sqlobject/events.py 2008-03-03 16:24:15 UTC (rev 3283)
+++ SQLObject/trunk/sqlobject/events.py 2008-03-03 16:25:18 UTC (rev 3284)
@@ -288,23 +288,6 @@
else:
return repr(v)
-try:
- sorted
-except NameError:
- # For Python 2.2 and 2.3:
- def sorted(lst, cmp=None, key=None, reverse=False):
- if key:
- lst = [(key(i), i) for i in lst]
- lst = lst[:]
- if cmp:
- lst.sort(cmp)
- else:
- lst.sort()
- if key:
- lst = [i for k, i in lst]
- if reverse:
- lst.reverse()
- return lst
__all__ = ['listen', 'send']
for name, value in globals().items():
Modified: SQLObject/trunk/sqlobject/main.py
===================================================================
--- SQLObject/trunk/sqlobject/main.py 2008-03-03 16:24:15 UTC (rev 3283)
+++ SQLObject/trunk/sqlobject/main.py 2008-03-03 16:25:18 UTC (rev 3284)
@@ -657,8 +657,8 @@
if warnings_level is not None and warnings_level <= level:
warnings.warn(message, DeprecationWarning, stacklevel=stacklevel)
-#if sys.version_info[:3] < (2, 4, 0):
-# deprecated("Support for Python 2.3 has been declared obsolete and will be removed in the next release of SQLObject")
+if sys.version_info[:3] < (2, 5, 0):
+ deprecated("Support for Python 2.4 has been declared obsolete and will be removed in the next release of SQLObject")
def setDeprecationLevel(warning=1, exception=None):
"""
Modified: SQLObject/trunk/sqlobject/versioning/test/test_version.py
===================================================================
--- SQLObject/trunk/sqlobject/versioning/test/test_version.py 2008-03-03 16:24:15 UTC (rev 3283)
+++ SQLObject/trunk/sqlobject/versioning/test/test_version.py 2008-03-03 16:25:18 UTC (rev 3284)
@@ -1,9 +1,3 @@
-try:
- sorted
-except NameError:
- # For Python 2.3:
- from sqlobject.events import sorted
-
from py.test import raises
from sqlobject import *
from sqlobject.inheritance import InheritableSQLObject
|
|
From: <sub...@co...> - 2008-03-03 16:24:27
|
Author: phd
Date: 2008-03-03 09:24:15 -0700 (Mon, 03 Mar 2008)
New Revision: 3283
Modified:
SQLObject/branches/0.10/setup.py
Log:
This branch doesn't support Python 2.2.
Modified: SQLObject/branches/0.10/setup.py
===================================================================
--- SQLObject/branches/0.10/setup.py 2008-03-03 16:09:49 UTC (rev 3282)
+++ SQLObject/branches/0.10/setup.py 2008-03-03 16:24:15 UTC (rev 3283)
@@ -13,13 +13,6 @@
'manager', 'maxdb', 'mysql', 'mssql', 'postgres', 'sqlite',
'sybase', 'util', 'versioning']
-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
-
kw = {}
if is_setuptools:
kw['entry_points'] = """
|
|
From: SourceForge.net <no...@so...> - 2008-03-03 16:10:11
|
Patches item #1673015, was opened at 2007-03-03 17:26 Message generated for change (Comment added) made by phd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1673015&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: Closed >Resolution: Accepted Priority: 5 Private: No Submitted By: Leandro Lucarella (llucax) Assigned to: Oleg Broytmann (phd) Summary: Use sets instead of dicts for used tables. Initial Comment: Since dicts are used as plain sets there, why not to just use sets? Yeah, I know, because of Python 2.2 compatibility :) Maybe some day... ---------------------------------------------------------------------- >Comment By: Oleg Broytmann (phd) Date: 2008-03-03 19:10 Message: Logged In: YES user_id=4799 Originator: NO There were these small problems: 1. E if t1 in tables: tables.remoce(t1) > AttributeError: 'set' object has no attribute 'remoce' [sqlobject/sqlbuilder.py:635] 2. E assert tablesUsedDict(x, None).keys() == ['not_yet_imported4 y'] > NameError: global name 'tablesUsedDict' is not defined [sqlobject/tests/test_sqlbuilder_importproxy.py:50] 3. E return d > NameError: global name 'd' is not defined [sqlobject/inheritance/__init__.py:21] I fixed them myself. Committed in the revisions 3281-3282 (0.10 and the trunk). Thank you! ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2008-03-03 18:15 Message: Logged In: YES user_id=240225 Originator: YES Sure, sorry about that... File Added: tablesdict.str.set-0.10.patch ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2008-03-03 18:04 Message: Logged In: YES user_id=4799 Originator: NO Thank you. There is also a tables dict in the method Select.__sqlrepr__(). Can you update it, too? (sqlbuilder.py, lines 622-632). ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2008-03-03 17:10 Message: Logged In: YES user_id=240225 Originator: YES Patch agains 0.10 attached. File Added: tablesdict.str.set-0.10.patch ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2008-03-03 16:19 Message: Logged In: YES user_id=4799 Originator: NO Please recreate the patch against the 0.10 branch: tablesUsedDict() has an additional parameter 'db'. ---------------------------------------------------------------------- Comment By: Oleg Broytmann (phd) Date: 2007-03-27 18:21 Message: Logged In: YES user_id=4799 Originator: NO Will be applied after SQLObject would have switched to Python 2.3. ---------------------------------------------------------------------- Comment By: Leandro Lucarella (llucax) Date: 2007-03-03 17:27 Message: Logged In: YES user_id=240225 Originator: YES File Added: tablesdict.str.set-trunk.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=540674&aid=1673015&group_id=74338 |
|
From: <sub...@co...> - 2008-03-03 16:09:55
|
Author: phd
Date: 2008-03-03 09:09:49 -0700 (Mon, 03 Mar 2008)
New Revision: 3282
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/converters.py
SQLObject/trunk/sqlobject/inheritance/__init__.py
SQLObject/trunk/sqlobject/sqlbuilder.py
SQLObject/trunk/sqlobject/sresults.py
SQLObject/trunk/sqlobject/tests/test_sqlbuilder_importproxy.py
Log:
Applied a patch 1673015 by Leandro Lucarella:
use sets instead of dicts in tablesUsed. Dropped tablesUsedDict function;
instead there is tablesUsedSet that returns a set of strings.
Modified: SQLObject/trunk/docs/News.txt
===================================================================
--- SQLObject/trunk/docs/News.txt 2008-03-03 16:09:00 UTC (rev 3281)
+++ SQLObject/trunk/docs/News.txt 2008-03-03 16:09:49 UTC (rev 3282)
@@ -40,8 +40,6 @@
* SQLBuilder Joins handle SQLExpression tables (not just str/SQLObject/Alias)
and properly sqlrepr.
-* SQLBuilder tablesUsedDict handles sqlrepr'able objects.
-
* Added SQLBuilder ImportProxy. It allows one to ignore the circular import
issues with referring to SQLObject classes in other files - it uses the
classregistry as the string class names for FK/Joins do, but specifically
@@ -80,6 +78,11 @@
* MySQLConnection (and DB URI) accept a number of SSL-related parameters:
ssl_key, ssl_cert, ssl_ca, ssl_capath.
+* Use sets instead of dicts in tablesUsed. Dropped tablesUsedDict function;
+ instead there is tablesUsedSet that returns a set of strings.
+
+* SQLBuilder tablesUsedSet handles sqlrepr'able objects.
+
SQLObject 0.9.4
===============
Modified: SQLObject/trunk/sqlobject/converters.py
===================================================================
--- SQLObject/trunk/sqlobject/converters.py 2008-03-03 16:09:00 UTC (rev 3281)
+++ SQLObject/trunk/sqlobject/converters.py 2008-03-03 16:09:49 UTC (rev 3282)
@@ -154,20 +154,11 @@
registerConverter(tuple, SequenceConverter)
registerConverter(list, SequenceConverter)
registerConverter(dict, SequenceConverter)
-try:
- set, frozenset
-except NameError:
- pass
-else:
- registerConverter(set, SequenceConverter)
- registerConverter(frozenset, SequenceConverter)
-try:
- from sets import Set, ImmutableSet
-except ImportError:
- pass
-else:
- registerConverter(Set, SequenceConverter)
- registerConverter(ImmutableSet, SequenceConverter)
+registerConverter(set, SequenceConverter)
+registerConverter(frozenset, SequenceConverter)
+from sets import Set, ImmutableSet
+registerConverter(Set, SequenceConverter)
+registerConverter(ImmutableSet, SequenceConverter)
if hasattr(time, 'struct_time'):
def StructTimeConverter(value, db):
Modified: SQLObject/trunk/sqlobject/inheritance/__init__.py
===================================================================
--- SQLObject/trunk/sqlobject/inheritance/__init__.py 2008-03-03 16:09:00 UTC (rev 3281)
+++ SQLObject/trunk/sqlobject/inheritance/__init__.py 2008-03-03 16:09:49 UTC (rev 3282)
@@ -5,17 +5,16 @@
makeProperties, getterName, setterName
import iteration
-
-def tablesUsedDict(obj, db):
- if hasattr(obj, "tablesUsedDict"):
- return obj.tablesUsedDict(db)
- elif isinstance(obj, (tuple, list)):
- d = {}
+def tablesUsedSet(obj, db):
+ if hasattr(obj, "tablesUsedSet"):
+ return obj.tablesUsedSet(db)
+ elif isinstance(obj, (tuple, list, set, frozenset)):
+ s = set()
for component in obj:
- d.update(tablesUsedDict(component, db))
- return d
+ s.update(tablesUsedSet(component, db))
+ return s
else:
- return {}
+ return set()
class InheritableSelectResults(SelectResults):
@@ -28,14 +27,14 @@
dbName = (ops.get('connection',None) or sourceClass._connection).dbName
- tablesDict = tablesUsedDict(clause, dbName)
- tablesDict[str(sourceClass.sqlmeta.table)] = 1
+ tablesSet = tablesUsedSet(clause, dbName)
+ tablesSet.add(str(sourceClass.sqlmeta.table))
orderBy = ops.get('orderBy')
if inheritedTables:
for tableName in inheritedTables:
- tablesDict[str(tableName)] = 1
+ tablesSet.add(str(tableName))
if orderBy and not isinstance(orderBy, basestring):
- tablesDict.update(tablesUsedDict(orderBy, dbName))
+ tablesSet.update(tablesUsedSet(orderBy, dbName))
#DSM: if this class has a parent, we need to link it
#DSM: and be sure the parent is in the table list.
#DSM: The following code is before clauseTables
@@ -47,7 +46,7 @@
allClasses = classregistry.registry(
sourceClass.sqlmeta.registry).allClasses()
for registryClass in allClasses:
- if str(registryClass.sqlmeta.table) in tablesDict:
+ if str(registryClass.sqlmeta.table) in tablesSet:
#DSM: By default, no parents are needed for the clauses
tableRegistry[registryClass] = registryClass
tableRegistryCopy = tableRegistry.copy()
@@ -74,7 +73,7 @@
parentClass = currentClass.sqlmeta.parentClass
parentClause.append(currentClass.q.id == parentClass.q.id)
currentClass = parentClass
- tablesDict[str(currentClass.sqlmeta.table)] = 1
+ tablesSet.add(str(currentClass.sqlmeta.table))
clause = reduce(sqlbuilder.AND, parentClause, clause)
super(InheritableSelectResults, self).__init__(sourceClass,
Modified: SQLObject/trunk/sqlobject/sqlbuilder.py
===================================================================
--- SQLObject/trunk/sqlobject/sqlbuilder.py 2008-03-03 16:09:00 UTC (rev 3281)
+++ SQLObject/trunk/sqlobject/sqlbuilder.py 2008-03-03 16:09:49 UTC (rev 3282)
@@ -182,15 +182,15 @@
return []
def tablesUsed(self, db):
- return self.tablesUsedDict(db).keys()
- def tablesUsedDict(self, db):
- tables = {}
+ return self.tablesUsedSet(db)
+ def tablesUsedSet(self, db):
+ tables = set()
for table in self.tablesUsedImmediate():
if hasattr(table, '__sqlrepr__'):
table = sqlrepr(table, db)
- tables[table] = 1
+ tables.add(table)
for component in self.components():
- tables.update(tablesUsedDict(component, db))
+ tables.update(tablesUsedSet(component, db))
return tables
def tablesUsedImmediate(self):
return []
@@ -204,9 +204,9 @@
registerConverter(SQLExpression, SQLExprConverter)
-def tablesUsedDict(obj, db):
- if hasattr(obj, "tablesUsedDict"):
- return obj.tablesUsedDict(db)
+def tablesUsedSet(obj, db):
+ if hasattr(obj, "tablesUsedSet"):
+ return obj.tablesUsedSet(db)
else:
return {}
@@ -613,22 +613,21 @@
join.append(_join)
else:
join.extend(_join)
- tables = {}
+ tables = set()
for x in self.ops['staticTables']:
if isinstance(x, SQLExpression):
x = sqlrepr(x, db)
- tables[x] = 1
+ tables.add(x)
things = list(self.ops['items']) + join
if self.ops['clause'] is not NoDefault:
things.append(self.ops['clause'])
for thing in things:
if isinstance(thing, SQLExpression):
- tables.update(tablesUsedDict(thing, db))
+ tables.update(tablesUsedSet(thing, db))
for j in join:
t1, t2 = sqlrepr(j.table1, db), sqlrepr(j.table2, db)
- if t1 in tables: del tables[t1]
- if t2 in tables: del tables[t2]
- tables = tables.keys()
+ if t1 in tables: tables.remove(t1)
+ if t2 in tables: tables.remove(t2)
if tables:
select += " FROM %s" % ", ".join(tables)
elif join:
Modified: SQLObject/trunk/sqlobject/sresults.py
===================================================================
--- SQLObject/trunk/sqlobject/sresults.py 2008-03-03 16:09:00 UTC (rev 3281)
+++ SQLObject/trunk/sqlobject/sresults.py 2008-03-03 16:09:49 UTC (rev 3282)
@@ -31,13 +31,13 @@
ops["start"] = 0
ops["end"] = ops.pop("limit")
- tablesDict = sqlbuilder.tablesUsedDict(self.clause, self._getConnection().dbName)
+ tablesSet = sqlbuilder.tablesUsedSet(self.clause, self._getConnection().dbName)
if clauseTables:
for table in clauseTables:
- tablesDict[table] = 1
+ tablesSet.add(table)
self.clauseTables = clauseTables
# Explicitly post-adding-in sqlmeta.table, sqlbuilder.Select will handle sqlrepr'ing and dupes
- self.tables = tablesDict.keys() + [sourceClass.sqlmeta.table]
+ self.tables = list(tablesSet) + [sourceClass.sqlmeta.table]
def queryForSelect(self):
columns = [self.sourceClass.q.id] + [getattr(self.sourceClass.q, x.name) for x in self.sourceClass.sqlmeta.columnList]
Modified: SQLObject/trunk/sqlobject/tests/test_sqlbuilder_importproxy.py
===================================================================
--- SQLObject/trunk/sqlobject/tests/test_sqlbuilder_importproxy.py 2008-03-03 16:09:00 UTC (rev 3281)
+++ SQLObject/trunk/sqlobject/tests/test_sqlbuilder_importproxy.py 2008-03-03 16:09:49 UTC (rev 3282)
@@ -6,46 +6,46 @@
def testSimple():
nyi = ImportProxy('NotYetImported')
x = nyi.q.name
-
+
class NotYetImported(SQLObject):
name = StringCol(dbName='a_name')
-
+
y = nyi.q.name
-
+
assert str(x) == 'not_yet_imported.a_name'
assert str(y) == 'not_yet_imported.a_name'
def testAddition():
nyi = ImportProxy('NotYetImported2')
x = nyi.q.name+nyi.q.name
-
+
class NotYetImported2(SQLObject):
name = StringCol(dbName='a_name')
-
+
assert str(x) == '((not_yet_imported2.a_name) + (not_yet_imported2.a_name))'
-
+
def testOnView():
nyi = ImportProxy('NotYetImportedV')
x = nyi.q.name
-
+
class NotYetImported3(SQLObject):
name = StringCol(dbName='a_name')
-
+
class NotYetImportedV(ViewSQLObject):
class sqlmeta:
idName = NotYetImported3.q.id
name = StringCol(dbName=NotYetImported3.q.name)
-
+
assert str(x) == 'not_yet_imported_v.name'
-
+
def testAlias():
nyi = ImportProxy('NotYetImported4')
y = Alias(nyi, 'y')
x = y.q.name
-
+
class NotYetImported4(SQLObject):
name = StringCol(dbName='a_name')
-
+
assert str(y) == 'not_yet_imported4 y'
- assert tablesUsedDict(x, None).keys() == ['not_yet_imported4 y']
- assert str(x) == 'y.a_name'
\ No newline at end of file
+ assert tablesUsedSet(x, None) == set(['not_yet_imported4 y'])
+ assert str(x) == 'y.a_name'
|