From: SourceForge.net <no...@so...> - 2004-05-28 00:36:45
|
Bugs item #961879, was opened at 2004-05-27 14:51 Message generated for change (Comment added) made by kingb You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=505345&aid=961879&group_id=63836 Category: Output: CreateDBAPI Group: v0.2 Status: Open Resolution: None Priority: 8 Submitted By: Brandon King (kingb) Assigned to: Nobody/Anonymous (nobody) Summary: Retrieving associated object from a new, uncommited object. Initial Comment: Retrieving an associated object from a new, uncommited object spews warnings, like the following: SELECT * FROM "attribute_value" WHERE "gene_fk" = None ERROR: column "none" does not exist It's trying to do an SQL query based on the objects primary key, which hasn't been created yet as it has not been committed. If this object had been commited, but didn't have an associated objects, it would return an empty list. I'd suggest that a new, uncommited object either return an empty list or throw an error of some sort. Example of problem: > myObj = dbs.MyObj() > myObj.getAssociatedObjects() SELECT * FROM "associated_object" WHERE "my_object_fk" = None ERROR: column "none" does not exist ---------------------------------------------------------------------- >Comment By: Brandon King (kingb) Date: 2004-05-27 17:36 Message: Logged In: YES user_id=552216 Okay, so a new uncommited object does return an empty list, like I was expecting, but I don't think the warning message should be shown in this situation as the SQL probably shouldn't even be executed when PK = None. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=505345&aid=961879&group_id=63836 |