Bugs item #1192037, was opened at 2005-04-29 02:44
Message generated for change (Comment added) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1192037&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: Postgres
Group: SQLObject release (specify)
>Status: Closed
>Resolution: Works For Me
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Oleg Broytmann (phd)
Summary: Must use implicit DEFAULT NULL when _fromDatabase=True
Initial Comment:
(PostgreSQL 8.0, psycopg 1.1.18, SQLObject 0.6.1)
Have the following table:
CREATE TABLE urls
(
id serial NOT NULL,
url varchar(80) NOT NULL,
download_finished timestamp,
email varchar(80) NOT NULL,
activated timestamp NOT NULL DEFAULT now(),
CONSTRAINT urls_pkey PRIMARY KEY (id)
)
WITHOUT OIDS;
And the following definition:
import sqlobject
c=sqlobject.connectionForURI('postgres://postgres:pass@localhost/db')
class Urls(sqlobject.SQLObject):
_connection = c
_fromDatabase = True
Then, in python shell:
>>> Urls(email='leha@leha', url='urltest')
....
TypeError: Urls() did not get expected keyword argument
downloadFinished
>>> Urls(email='leha@leha', url='urltest',
downloadFinished=None)
<Urls 3L url='urltest' downloadFinished=None
email='leha@leha' activated =<DateTime object for
'2005-04-29 00:35:34.80' at cc02a0>>
As you can see SQLObject honours explicit DEFAULT
declaration (now() for activated column), but no
implicit (NULL for download_finished).
----------------------------------------------------------------------
>Comment By: Oleg Broytmann (phd)
Date: 2008-03-07 18:29
Message:
Logged In: YES
user_id=4799
Originator: NO
test = Urls(email='leha@leha', url='urltest')
print test.downloadFinished
prints 'None' under Postgres and SQLite, SQLObject 0.9.4.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-05-26 17:41
Message:
Logged In: YES
user_id=4799
This is probably Postgres issue. Can you look at
PostgresConnection.columnsFromSchema(), run the colQuery
manually and report the results?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1192037&group_id=74338
|