#35 Joining on foreign keys with selectBy expects odd col names.

closed-fixed
nobody
General (125)
5
2005-04-11
2004-08-19
No

Given classes like:

class FileInfo(SQLObject):
package = ForeignKey('package')
# ...

class Package(SQLObject):
name = StringCol()
# ...

I'd expect to be able to do:

FileInfo.selectBy(package=some_package)

(where some_package is an instance of Package)

Instead, SQLObject seems to require:

FileInfo.selectBy(packageID=some_package)

No amount of specifying dbName and friends in the
column declarations will avoid the need to add 'ID' to
the column name. This seems very odd to me; the column
is called 'package', the attribute is called 'package';
why do I need to call it by something else?

Discussion

  • Oleg Broytman

    Oleg Broytman - 2005-04-11
    • status: open --> closed-fixed
     
  • Oleg Broytman

    Oleg Broytman - 2005-04-11

    Logged In: YES
    user_id=4799

    Fixed at revision 721 (patch 1176359).

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks