Daniel Dehennin | 1 Feb 14:53

Closing connection

Hello,

I'm looking at improving tests of rebuildd[1].

The test suite create and delete the database[2] for each test in the
setUp()[3] method, but sqlobject don't like it.

The first test is OK but all successives ones fail with "disk I/O error".

I found a thread[4] on the list speaking about the same issue but I do
not manage to fix my tests.

Any hints?

Regards.

Footnotes: 
[1]  http://packages.qa.debian.org/rebuildd

[2]  http://anonscm.debian.org/gitweb/?p=rebuildd/rebuildd.git;a=blob;f=tests/RebuilddTestSetup.py;h=d677d8e481baada9218d9f86687a818c87b28582;hb=HEAD

[3]  http://anonscm.debian.org/gitweb/?p=rebuildd/rebuildd.git;a=blob;f=tests/TestJob.py;h=20e81d6c3de9a50ddb4a95c04593d739f31dbec8;hb=HEAD#l16

[4]  http://thread.gmane.org/gmane.comp.python.sqlobject/5769

--

-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
(Continue reading)

Petr Jakeš | 29 Jan 11:06
Picon

troubles with unicode

I am lost,
trying to find solution whole night long.

all attempts to call the set method (see bellow) are finishing:

Page handler: <bound method ProdejniMista.ulozeniProdejnihoMista of <fantomas.controllers.ProdejniMista instance at 0x2ac67a0>> Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/cherrypy/_cphttptools.py", line 121, in _run self.main() File "/usr/lib/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/cherrypy/_cphttptools.py", line 264, in main body = page_handler(*virtual_path, **self.params) File "<string>", line 3, in ulozeniProdejnihoMista File "/usr/local/lib/python2.5/site-packages/TurboGears-1.0.8-py2.5.egg/turbogears/controllers.py", line 360, in expose *args, **kw) File "<string>", line 5, in run_with_transaction File "/usr/local/lib/python2.5/site-packages/TurboGears-1.0.8-py2.5.egg/turbogears/database.py", line 359, in so_rwt retval = func(*args, **kw) File "<string>", line 5, in _expose File "/usr/local/lib/python2.5/site-packages/TurboGears-1.0.8-py2.5.egg/turbogears/controllers.py", line 373, in <lambda> mapping, fragment, args, kw))) File "/usr/local/lib/python2.5/site-packages/TurboGears-1.0.8-py2.5.egg/turbogears/controllers.py", line 410, in _execute_func output = errorhandling.try_call(func, *args, **kw) File "/usr/local/lib/python2.5/site-packages/TurboGears-1.0.8-py2.5.egg/turbogears/errorhandling.py", line 77, in try_call return func(self, *args, **kw) File "/TG_web/fantomas/controllers.py", line 305, in ulozeniProdejnihoMista prodMisto.set(**slovnikArgumentu) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.1-py2.5.egg/sqlobject/main.py", line 1120, in set self._connection._SO_update(self, args) File "/usr/lib/python2.5/site-packages/SQLObject-0.10.1-py2.5.egg/sqlobject/dbconnection.py", line 509, in _SO_update for dbName, value in values]), UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 33: ordinal not in range(128)
I have tried all possible combination to decode/encode the field values and I am really sure all filelds are unicode fields when i am trying call the set method.



automat.set(**slovnikArgumentu)


automat.set(telKontaktniOsoby = slovnikArgumentu[telKontaktniOsoby].encode("utf-8"),
            najemZaRokBezDph = slovnikArgumentu[najemZaRokBezDph].encode("utf-8"),
            kontaktniOsobaPrijmeni = slovnikArgumentu[kontaktniOsobaPrijmeni].encode("utf-8"),
            nazevKontaktMistaPoruchy = slovnikArgumentu[nazevKontaktMistaPoruchy].encode("utf-8"),
            psc = slovnikArgumentu[psc].encode("utf-8"),
            mesto = slovnikArgumentu[mesto].encode("utf-8"),
            adresa2 = slovnikArgumentu[adresa2].encode("utf-8"),
            adresa1 = slovnikArgumentu[adresa1].encode("utf-8"),
            zemDelka = slovnikArgumentu[zemDelka].encode("utf-8"),
            zemSirka = slovnikArgumentu[zemSirka].encode("utf-8"),
            elektrinaZaRokBezDph = slovnikArgumentu[elektrinaZaRokBezDph].encode("utf-8"),
            cisloSignysPartnera = slovnikArgumentu[cisloSignysPartnera].encode("utf-8"),
            pmid = slovnikArgumentu[pmid].encode("utf-8"),
            telReseniPoruchy = slovnikArgumentu[telReseniPoruchy].encode("utf-8"),
            nazevProdejnihoMista = slovnikArgumentu[nazevProdejnihoMista].encode("utf-8"),
            dnuRokOtevreno = slovnikArgumentu[dnuRokOtevreno].encode("utf-8"),
            kontaktniOsobaJmeno = slovnikArgumentu[kontaktniOsobaJmeno].encode("utf-8"))


My Environment:
Ubuntu Hardy Heron 64bit minimal server install

vs2521:/TG_web# yolk -l
Cheetah         - 2.4.4        - active
CherryPy        - 2.3.0        - active
DecoratorTools  - 1.8          - active
Extremes        - 1.1.1        - active
FormEncode      - 1.2.4        - active
Markdown        - 2.1.1        - active
PIL             - 1.1.6        - active
Paste           - 1.7.5.1      - active
PasteDeploy     - 1.5.0        - active
PasteScript     - 1.7.5        - active
PyProtocols     - 1.0a0dev-r2302 - active
Python          - 2.5.2        - active development (/usr/lib/python2.5/lib-dynload)
RuleDispatch    - 0.5a1.dev-r2506 - active
SQLObject       - 0.10.1       - active
TurboCheetah    - 1.0          - active
TurboGears      - 1.0.10       - non-active
TurboGears      - 1.0.8        - active development (/usr/local/lib/python2.5/site-packages/TurboGears-1.0.8-py2.5.egg)
TurboJson       - 1.1.4        - active
TurboKid        - 1.0.5        - active
configobj       - 4.7.2        - active
egenix-mx-base  - 3.2.2        - active
kid             - 0.9.6        - active
kinterbasdb     - 3.3.0        - active
pip             - 1.0.2        - active
pygooglechart   - 0.3.0        - active
setuptools      - 0.6c11       - non-active
setuptools      - 0.6c12dev-r88846 - active
setuptools      - 0.6c8        - non-active
simplejson      - 2.3.2        - active
wsgiref         - 0.1.2        - active development (/usr/lib/python2.5)
yolk            - 0.4.1        - active

Thanks for your hints

Petr
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
Oleg Broytman | 29 Dec 19:35
X-Face
Favicon

Re: Reference to one of multiple tables

On Thu, Dec 29, 2011 at 03:48:09PM +0100, Frank Wagner wrote:
> http://sqlobject.org/Inheritance.html

   Please be warned this kind of inheritance in SQLObject is very
limited. The page mentioned above lists some limitations.

   Timo, I'm going to write a more detailed answer a bit later.

Oleg.
--

-- 
     Oleg Broytman            http://phdru.name/            phd <at> phdru.name
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
Timo | 29 Dec 00:25
Picon

Fwd: Reference to one of multiple tables

Sorry, forwarding to list. Overlooked the reply-all button in Gmail interface.


2011/12/28 Petr Jakeš <petr.jakes <at> tpc.cz>

I'm stuck at a part of my program, but I'm not sure if this is the right place to ask. Excuses if it's not.

I have a DVD object which can have different statusses, like "on loan", "sold", etc... A dvd can only have 1 status at the time, but I'm confused about how to link it to 1 table only so I can access the correct status with dvd.status .

Here's an example:

class DVD(SQLObject):
    status = ???? # Should be sold or onloan data
    # ... special "dvd" data

class Sold(SQLObject):
    dvd = ForeignKey('DVD')
    # ... special "sold" data

class OnLoan(SQLObject):
    dvd = ForeignKey('DVD')
    # ... special "on loan" data

Why not just one table and the sqlmeta?

connection = connectionForURI('sqlite:/:memory:')

class DVD(SQLObject):
    _connection = connection
    title = StringCol(default="")
    inShelve = BoolCol(default=True)
    sold = BoolCol(default=False)
    onLoan = BoolCol(default=False)
    def _get_statuss(self):
        if self.sold:
            return "sold"
        elif self.onLoan:
            return "onLoan"
        elif self.inShelf:
            return "inShelf"
DVD.createTable()           
myFirstDVD = DVD(title="Timo")
print myFirstDVD.statuss


The statusses have all kind of information too, like price and buyer for sold dvd's and return date for example in the loaned status.
But your example got me thinking. Is something like the following valid? (working example)
from sqlobject import *


connection = connectionForURI('sqlite:/:memory:')

class Sold(SQLObject):
    _connection = connection

    dvd = ForeignKey('DVD')
    buyer = StringCol(default="")

class OnLoan(SQLObject):
    _connection = connection

    dvd = ForeignKey('DVD')
    returnDate = DateCol(default=None)


class DVD(SQLObject):
    _connection = connection
    title = StringCol(default="")
    inShelve = BoolCol(default=True)
    sold = SingleJoin('Sold', joinColumn='dvd')
    onLoan = SingleJoin('OnLoan', joinColumn='dvd')
    def _get_statuss(self):
        if self.inShelf:
            return
        elif self.sold is not None:
            return self.sold
        elif self.onLoan is not None:
            return self.onLoan
DVD.createTable() 
Sold.createTable()
OnLoan.createTable()     
myFirstDVD = DVD(title="Timo")
s = Sold(dvd=myFirstDVD)
print myFirstDVD.statuss

But then I should handle the inShelve bool value whenever self.sold or self.onLoan are changed.

Greets and thanks,
Timo
 
HTH

Petr


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
Timo | 28 Dec 22:30
Picon

Reference to one of multiple tables

I'm stuck at a part of my program, but I'm not sure if this is the right place to ask. Excuses if it's not.

I have a DVD object which can have different statusses, like "on loan", "sold", etc... A dvd can only have 1 status at the time, but I'm confused about how to link it to 1 table only so I can access the correct status with dvd.status .

Here's an example:

class DVD(SQLObject):
    status = ???? # Should be sold or onloan data
    # ... special "dvd" data

class Sold(SQLObject):
    dvd = ForeignKey('DVD')
    # ... special "sold" data

class OnLoan(SQLObject):
    dvd = ForeignKey('DVD')
    # ... special "on loan" data

Greets,
Timo

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
Glenn Rutkowski | 10 Dec 23:47

Application Design Question


I need help managing my project files.  I've got over 120 class files 
each that have their own specific validation routines.  Most of which 
are pretty tame, but some are pretty nasty.  Anyways, I took a stab at a 
creating one .py file for each class, but it's turning out to be a mess 
of include statements.  Going back to a single file makes for a HUGE 
file which is manageable, but annoying when searching for particular code.

Anyways - I though I'd ask to see if there were any examples or 
resources out there that I could look at that would help me clean this up.

Thanks,

Glenn

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
Oleg Broytman | 4 Dec 18:24
X-Face
Favicon

SQLObject 1.2.1

Hello!

I'm pleased to announce version 1.2.1, the first stable release of branch
1.2 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://pypi.python.org/pypi/SQLObject/1.2.1

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

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

* A bug was fixed in handling ``modulo`` operator - SQLite implements
  only ``%``, MySQL - only ``MOD()``, PostgreSQL implements both.

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

Oleg.
--

-- 
     Oleg Broytman            http://phdru.name/            phd <at> phdru.name
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
Oleg Broytman | 4 Dec 18:20
X-Face
Favicon

SQLObject 1.1.4

Hello!

I'm pleased to announce version 1.1.4, a bugfix release of branch
1.1 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://pypi.python.org/pypi/SQLObject/1.1.4

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

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

* A bug was fixed in handling ``modulo`` operator - SQLite implements
  only ``%``, MySQL - only ``MOD()``, PostgreSQL implements both.

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

Oleg.
--

-- 
     Oleg Broytman            http://phdru.name/            phd <at> phdru.name
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
Oleg Broytman | 20 Nov 13:17
X-Face
Favicon

SQLObject 1.2.0

Hello!

I'm pleased to announce version 1.2.0, the first stable release of branch
1.2 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://pypi.python.org/pypi/SQLObject/1.2.0

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

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

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

* Strings are treated specially in Select to allow
  Select(['id, 'name'], where='value = 42'). Update allows a string in
  WHERE.

* ForeignKey('Table', refColumn='refcol_id') to allow ForeignKey to
  point to a non-id column; the referred column must be a unique integer
  column.

* delColumn now accepts a ForeignKey's name without 'ID'.

* Support for PostgreSQL 7.* is dropped. The minimal supported version of
  PostgreSQL is 8.1 now.

* Quoting rules changed for PostgreSQL: SQLObject uses E'' escape string
  if the string contains characters escaped with backslash.

* A bug caused by psycopg2 recently added a new boolean not callable
  autocommit attribute was fixed.

* sqlobject.__doc__ and main.__doc__ no longer contain version number.
  Use sqlobject.version or version_info.

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

Oleg.
--

-- 
     Oleg Broytman            http://phdru.name/            phd <at> phdru.name
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
Oleg Broytman | 12 Nov 14:34
X-Face
Favicon

SQLObject 1.2.0b1-py2.7

Hello!

   I've added Python 2.7 to my development environment and just uploaded
SQLObject-1.2.0b1dev_r4477-py2.7.egg:

see https://pypi.python.org/pypi/SQLObject/1.2.0b1dev-r4477

Oleg.
--

-- 
     Oleg Broytman            http://phdru.name/            phd <at> phdru.name
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
Oleg Broytman | 5 Nov 15:52
X-Face
Favicon

SQLObject 1.2.0b1

Hello!

I'm pleased to announce version 1.2.0b1, the first beta of the upcoming
release of branch 1.2 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://pypi.python.org/pypi/SQLObject/1.2.0b1dev-r4477

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

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

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

* Strings are treated specially in Select to allow
  Select(['id, 'name'], where='value = 42'). Update allows a string in
  WHERE.

* ForeignKey('Table', refColumn='refcol_id') to allow ForeignKey to
  point to a non-id column; the referred column must be a unique integer
  column.

* delColumn now accepts a ForeignKey's name without 'ID'.

* Support for PostgreSQL 7.* is dropped. The minimal supported version of
  PostgreSQL is 8.1 now.

* Quoting rules changed for PostgreSQL: SQLObject uses E'' escape string
  if the string contains characters escaped with backslash.

* A bug caused by psycopg2 recently added a new boolean not callable
  autocommit attribute was fixed.

* sqlobject.__doc__ and main.__doc__ no longer contain version number.
  Use sqlobject.version or version_info.

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

Oleg.
--

-- 
     Oleg Broytman            http://phdru.name/            phd <at> phdru.name
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1

Gmane