Jim Steil | 12 May 19:57

Log changes to rows

Hi:

Is there an easy way to log CRUD changes to a table?  I know that I 
could do it by overriding all of the update methods, but that seems to 
be not right.  Googling for things like 'sqlobject log changes' just 
bring back references to logging at a lower level.  Any pointers would 
be appreciated.

    -Jim

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Picon

forceDBName=False

Hi, trying to connect to the existing Firebird database from the Windows XP machine, I am getting following strange Error:

import *
from sqlobject.sqlbuilder import *

db_filename = 'd|/sgdata/test/sysdat01.gdb'
connection_string = 'firebird://172.18.0.10:3050/' + db_filename
connection = connectionForURI(connection_string)

class Cenktgm01(SQLObject):
   _connection = connection   
   class sqlmeta:       
       fromDatabase = True

Cenktgm01._connection.debug = True
myTry = Cenktgm01()



Microsoft Windows XP [Verze 5.1.2600]
C:\automat>python pokusy.py
Traceback (most recent call last):
  File "pokusy.py", line 54, in <module>
    class Cenktgm01(SQLObject):
  File "C:\Python25\lib\site-packages\sqlobject-0.10dev_r3187-py2.5.egg\sqlobject\declarative.py", line 112, in __new__
    cls.__classinit__(cls, new_attrs)
  File "C:\Python25\lib\site-packages\sqlobject-0.10dev_r3187-py2.5.egg\sqlobject\main.py", line 781, in __classinit__
    cls.sqlmeta.addColumnsFromDatabase()
  File "C:\Python25\lib\site-packages\sqlobject-0.10dev_r3187-py2.5.egg\sqlobject\main.py", line 443, in addColumnsFromDatabase
    sqlmeta.addColumn(columnDef)
  File "C:\Python25\lib\site-packages\sqlobject-0.10dev_r3187-py2.5.egg\sqlobject\main.py", line 369, in addColumn
    setter = eval('lambda self, val: self._SO_setValue(%s, val, self.%s, self.%s)' % (repr(name), '_SO_from_python_%s' % name, '_SO_to_python_%s'
% name))
  File "<string>", line 1
    lambda self, val: self._SO_setValue('p$defkod', val, self._SO_from_python_p$defkod, self._SO_to_python_p$defkod)
                                                                               ^
SyntaxError: invalid syntax


Thanks for your comments

Petr


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
chris | 6 May 20:52

better way to manually commit changes to database....?

In my TurboGears/SQLObject app, I manually commit changes to the database
with a line like the following...

MyObject._connection.commit()

It works but looks ugly since _connection is "private variable" that should not
be accessed right?

Chris

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
chris | 6 May 20:35

Why must SQLObject expose database connections to users's?

Why does my TurboGears/SQLObject app need an explicit connection to database to
be exposed?

I'm thinking of the following line which *MUST* appear....

__connection__ = turbogears.database.PackageHub("myapp")

Isn't a goal for ORMs to hide all this database connection stuff?

Chris

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Oleg Broytmann | 4 May 16:15
X-Face
Picon
Favicon

SQLObject 0.10.1

Hello!

I'm pleased to announce version 0.10.1, a 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.1

News and changes:
http://sqlobject.org/News.html

What's New
==========

News since 0.10.0
-----------------

Bug Fixes
~~~~~~~~~

* Fixed a bug: limit doesn't work in sqlbuilder.Select.

* A bug in inheritable delColumn() that doesn't remove properties was fixed.

* A minor bug was fixed in col.py - the registry must be passed to findClass().

* Reverted the patch declarative.threadSafeMethod() - it causes more harm
  then good.

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

Oleg.
--

-- 
     Oleg Broytmann            http://phd.pp.ru/            phd <at> phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Oleg Broytmann | 4 May 16:11
X-Face
Picon
Favicon

SQLObject 0.9.6

Hello!

I'm pleased to announce version 0.9.6, a minor bug fix release 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.9.6

News and changes:
http://sqlobject.org/News.html

What's New
==========

News since 0.9.5
----------------

Bug Fixes
~~~~~~~~~

* A bug in inheritable delColumn() that doesn't remove properties was fixed.

* A minor bug was fixed in col.py - the registry must be passed to findClass().

* Reverted the patch declarative.threadSafeMethod() - it causes more harm
  then good.

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

Oleg.
--

-- 
     Oleg Broytmann            http://phd.pp.ru/            phd <at> phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
David McNab | 28 Apr 10:42
Picon

emulating 'nested tables'

Hi,

I've prototyped a database using Metakit (which allows tables to have
nested tables as columns), and want to migrate it over to use SQLObject.

Consider:

  class Foo(SQLObject):
    someattr = IntCol()
    otherattr = StringCol()
    things = MultipleJoin("Thing")

  class Thing(SQLObject):
    attr1 = BoolCol()
    attr2 = StringCol()
    foo = ForeignKey("Foo")

This will give an effect similar to 'nested tables', since the '.things'
attribute of any Foo object will yield a list of Thing records.

But if the database grows to having tens of thousands, even millions of
rows in each table, then accessing '.things' could prove pretty slow.

Another option is to look into dynamic creation of tables, where for
each Foo object I create a dynamic Thing-like class. But I don't know
how I could get the convenience similar to just fetching '.things'
attributes of Foo objects to access each dynamic table.

Can anyone suggest the best way to get decent scalable performance with
this scenario?

Cheers
David

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Matthew Wilson | 27 Apr 23:24
Favicon

How to do a single big join rather than lots of little joins?

I've got a table of employees and a table of departments and a related
table that joins the two.

So when I do

    for dept in employee.departments:

the SQLObject machinery runs a separate query for each department row.
Sometimes, this is fine, but sometimes, I want to do a query where I
grab every department all at once.

I have been manually adding classmethods when I need the "all-at-once"
join to happen, so then I do:

    for dept in employee.get_all_departments_at_once():

Is there a better way to do what I'm doing?

I find that running lots and lots of single queries is really slow, so
in a lot of cases, I prefer to just grab everything.

Matt

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Fred C | 23 Apr 01:13
Picon

LEFTJOINOn question


I have that request

articles = model.Article.select(
	model.Comment.q.id != None,
	join = LEFTJOINOn(None, model.Comment,
		model.Comment.q.articleID == model.Article.q.id),
	orderBy='-created')

which is translated into

SELECT article.id, article.link, article.title, article.summary,  
article.updated, article.rss_id, article.user_id, article.category_id  
FROM article LEFT JOIN comment ON ((comment.article_id) =  
(article.id)) WHERE ((comment.id) IS NOT NULL) ORDER BY created DESC

Since I am doing a LEFT JOIN it seems natural for me to have the  
request returning the fields from both tables article and comment. How  
can I have sqlobject returning the fields from both tables.

-fred

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Daniel Fetchinson | 21 Apr 06:24

the future of sqlobject

Oleg, I was searching for a document outlining the future of sqlobject
but couldn't find any so here it goes:

In the current development phase are you primarily concentrating on
bug fixes and maintenance releases?
Do you have plans for developing totally new features?
Would you be willing to develop new features if they are requested?
How long you think you will support sqlobject?

I would be grateful for any other thoughts you might have on the subject!

And thanks for the great work you have done for sqlobject users like myself.

Cheers,
Daniel

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
Fred C | 18 Apr 01:02
Picon

sqlobjects and threads


I was wandering if there is somewhere an sqlobject 101 for threading  
environment?
I have been googleing for infomation but everything seems confusing.

Thanks
-fred- 

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

Gmane