Oleg Broytman | 6 Jan 16:53 2015
X-Face

SQLObject 2.1.0

Hello!

I'm pleased to announce version 2.1.0, the first stable release of branch
2.1 of SQLObject.

What's new in SQLObject
=======================

Minor features
--------------

* In queries generated with SQLObject's tables columns are sorted in the
  order they are declared in the table.

* In queries generated with sqlbuilder's Insert/Update, if values are
  passed using dictionaries, columns are sorted alphabetically.

* Tables in SELECT...FROM clause are sorted alphabetically.

* MySQLConnection, PostgresConnection and SQLiteConnection have got
  a new method listDatabases() that lists databases in the connection
  and returns a list of names.

* MySQLConnection, PostgresConnection and SQLiteConnection have got
  a new method listTables() that returns a list of table names in the database.

Contributor for this release is Ian Cordasco.

For a more complete list, please see the news:
http://sqlobject.org/News.html
(Continue reading)

Oleg Broytman | 5 Jan 13:50 2015
X-Face

Flake8 fixes

Hello, All!

   Ian Cordasco and I split the work on flake8 fixes by error number. If
you want to help developing SQLObject see issues marked with [flake8] at
https://github.com/sqlobject/sqlobject/issues . The simpler issues
(lower number of lines) are also labeled "low-hanging fruit":
https://github.com/sqlobject/sqlobject/issues?q=is%3Aopen+label%3A%22low-hanging+fruit%22

   The recommended workflow:

1. Announce here you want to work on an issue; I'll assign the issue to
you. This is to avoid duplication of effort.

2. Fix the problems in the code. If the description in the issue isn't
detailed enough -- I can show the exact lines in the files.

3. Test with flake8 (I use vim-flake8 plugin but that's up to you). If
the error is ignored in setup.cfg -- remove it before testing; remove
both the comment and the error from "ignore" list.

3. Commit to branch "flake8-fixes"; do ``git pull --rebase`` before
pushing, then ``git push origin flake8-fixes``. Create a pull request
from your commit.

4. Please do one commit per issue. The biggest issues (with hundreds
lines) perhaps require a few commits. Make your commit message something
like "Fix #xxx flake8 Eyyy", where #xxx is the issue's number and yyy is
the error; for example "Fix #50 flake8 E401". "Fix #xxx" makes github
automatically close the issue.

(Continue reading)

Gregor Horvath | 5 Jan 12:19 2015

autoCommit=False and Transaction -> SQLObjectNotFound on creation

Hello,

Problem: 

$ dropdb scratch; createdb scratch; python /tmp/scratch.py 
Traceback (most recent call last):
  File "/tmp/scratch.py", line 25, in <module>
    er = Eingangsrechnung(name="test")
  File
 "/home/gregor/work/gnucash/testve/local/lib/python2.7/site-packages/sqlobject/main.py",
line 1226, in __init__
    self._create(id, **kw)
  File
 "/home/gregor/work/gnucash/testve/local/lib/python2.7/site-packages/sqlobject/main.py",
line 1274, in _create
    self._SO_finishCreate(id)
  File
 "/home/gregor/work/gnucash/testve/local/lib/python2.7/site-packages/sqlobject/main.py",
line 1301, in _SO_finishCreate
    self._init(id)
  File
 "/home/gregor/work/gnucash/testve/local/lib/python2.7/site-packages/sqlobject/main.py",
line 934, in _init
    raise SQLObjectNotFound, "The object %s by the ID %s does not
 exist" % (self.__class__.__name__, self.id)
sqlobject.main.SQLObjectNotFound: The object Eingangsrechnung by the ID
1 does not exist

--------------------

(Continue reading)

Michael Root | 30 Dec 18:53 2014

Accumulation functions over limited results


Hi.

Ran into an issue the other day, which I think could be described as a bug, or 
perhaps a mis-feature, depending on how you look at it.

If you use an accumulator function on a SelectResults object (sum, avg, etc.), 
it will silently do the "wrong thing" if that SelectResults object has a LIMIT 
in it.

Now, I understand that adding a LIMIT to a standard SQL query won't affect the 
result either:

     SELECT AVG(size) FROM Thing ORDER BY size LIMIT 5

This will return the average size of all rows, not just the smallest 5, as if 
the ORDER BY and LIMIT weren't there at all.  In this sense, the current 
behavior of SQLObject is correct.

However, consider this code:

     class Thing(SQLObject):
         size = IntCol()

     things = [Thing(size=n) for n in range(10)]

     allThings = Thing.select()
     smallThings = allThings.orderBy(Thing.q.size).limit(5)
     bigThings = allThings.orderBy(Thing.q.size).reversed().limit(5)
     evenThings = allThings.filter(Thing.q.size % 2 == 0)
(Continue reading)

Oleg Broytman | 20 Dec 19:19 2014
X-Face

SQLObject 2.0

Hello!

I'm pleased to announce version 2.0.0, the first stable release of branch
2.0 of SQLObject.

What's new in SQLObject
=======================

Features & Interface
--------------------

* DateTimeCol and TimeCol can read and write values with microseconds.

  WARNING: microseconds are supported by MariaDB since version 5.3.0 and
  by MySQL since version 5.6.4, and even these versions require special
  handling: columns to store microseconds have to be declared with
  precision 6: TIME(6), DATETIME(6), TIMESTAMP(6). SQLObject does the
  right thing when creating a new database but existing databases have
  to be changed: run something like
  ``ALTER TABLE name MODIFY COLUMN col TIME(6)`` for every column that
  you want to store microseconds.

  WARNING: backward compatibility problem! Date/Time columns created
  with microseconds cannot be read back from SQLite databases (and
  perhaps other backends) with versions of SQLObject older than 1.7.

Minor features
--------------

* PostgresConnection, when used with fromDatabase=True, sets alternateID
(Continue reading)

Oleg Broytman | 18 Dec 18:22 2014
X-Face

SQLObject 1.7.3

Hello!

I'm pleased to announce version 1.7.3, a release with minor
documentation update of branch 1.7 of SQLObject.

What's new in SQLObject
=======================

* Extend setup.py: include docs and tests into the egg.

For a more complete list, please see the news:
http://sqlobject.org/News.html

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).

Python 2.6 or 2.7 is required.

Where is SQLObject
==================

Site:
http://sqlobject.org
(Continue reading)

Oleg Broytman | 18 Dec 18:22 2014
X-Face

SQLObject 1.6.4

Hello!

I'm pleased to announce version 1.6.4, a release with minor
documentation update of branch 1.6 of SQLObject.

What's new in SQLObject
=======================

* Extend setup.py: include docs and tests into the egg.

For a more complete list, please see the news:
http://sqlobject.org/News.html

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).

Python 2.5 or higher is required.

Where is SQLObject
==================

Site:
http://sqlobject.org
(Continue reading)

Oleg Broytman | 18 Dec 18:21 2014
X-Face

SQLObject 1.5.6

Hello!

I'm pleased to announce version 1.5.6, a release with minor
documentation update of branch 1.5 of SQLObject.

What's new in SQLObject
=======================

* Extend setup.py: include docs and tests into the egg.

For a more complete list, please see the news:
http://sqlobject.org/News.html

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).

Python 2.4 or higher is required.

Where is SQLObject
==================

Site:
http://sqlobject.org
(Continue reading)

Oleg Broytman | 14 Dec 15:51 2014
X-Face

SQLObject 1.7.2

Hello!

I'm pleased to announce version 1.7.2, a bugfix release of branch
1.7 of SQLObject.

What's new in SQLObject
=======================

* Fix a bug: zero-pad microseconds on the right, not on the left; 0.0835
  seconds means 83500 microseconds.

For a more complete list, please see the news:
http://sqlobject.org/News.html

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

(Continue reading)

Oleg Broytman | 11 Dec 13:46 2014
X-Face

SQLObject 1.7.1, 1.6.3, 1.5.5

Hello!

I'm pleased to announce versions 1.7.1, 1.6.3 and 1.5.5, documentation
update releases of SQLObject.

What's new in SQLObject
=======================

* Documentation update: change URLs for development with git, add
  Travis CI build status image.

* Extend sdist: include everything (even generated html)
  into source distribution.

For a more complete list, please see the news:
http://sqlobject.org/News.html

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
==================

(Continue reading)

Fetchinson . | 10 Dec 00:47 2014

caching an expensive property

What's the best strategy for some kind of caching of an expensive property?

Let's say I have the following:

class obj( SQLObject ):
    somefield = StringCol( )
    someotherfield = StringCol( )

    def _get_expensivestuff( self ):
        # takes a long time
        return result

And if my obj instance is alive for a long time and expensivestuff
gets accessed many times I'd like to just compute result once, store
it somewhere (where?) and return it from there.

I'm aware of memoizing the result of a function using a suitable
decorator but I'm concerned about thread safety and I'm not terribly
knowledgeable about the internals of sqlobject.

Any ideas would help a lot. Thanks,
Daniel

--

-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
(Continue reading)


Gmane