Thread: [SQLObject] *id* column mandatory? BLOBS ?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Jim V. <Jim...@no...> - 2003-08-13 19:13:50
|
Hello, From the documentation, it appears that SQLObject is for use with tables that have an *id* column. May SQLObject be used with tables that do not have an *id* column? Also, a previous post asked about support for BLOBS. Presently, there appears to be no such support. Are there plans to support BLOBS? Thanks, -- jv |
From: Jim V. <Jim...@no...> - 2003-08-13 20:15:56
|
Thanks for the information. Sorry that my question was imprecisely worded. May SQLObject be used with a table that has no primary key column (e.g., with a table whose key is a combination of columns -- some perhaps being non-integer)? -- jv Dave Poirier wrote: > On Wed, 2003-08-13 at 13:36, Jim Vickroy wrote: > > Hello, > > > > >From the documentation, it appears that SQLObject is for use with tables > > that have an *id* column. May SQLObject be used with tables that do not > > have an *id* column? > > > > Also, a previous post asked about support for BLOBS. Presently, there > > appears to be no such support. Are there plans to support BLOBS? > > > > Thanks, > > > > -- jv > > Yes, it is possible to name another column as being the primary key. > > alternateID: > > This boolean (default False) indicates if the column can be used as > an ID for the field (for instance, a username), though it is not a > primary key. If so a class method will be added, like byUsername which > will return that object. Use alternateMethodName if you don't like the > by* name (e.g. alternateMethodName="username"). > > The column should be declared UNIQUE in your table schema. > > see http://sqlobject.org/docs/SQLObject.html for further details. > > -Dave |
From: Frank B. <fb...@fo...> - 2003-08-13 22:00:09
|
Hallo, Jim Vickroy hat gesagt: // Jim Vickroy wrote: > May SQLObject be used with a table that has no primary key column (e.g., with a > table whose key is a combination of columns -- some perhaps being non-integer)? Currently no. An integer ID column is mandatory. From the docs: "You can override the name, but some integer primary key must exist." ciao -- Frank Barknecht _ ______footils.org__ |
From: Jim V. <Jim...@no...> - 2003-08-14 14:36:37
|
Thanks for the confirmation. I asked this question, because we have some existing tables that do not have an integer primary key, but I seem to be able to use SQLObject to read from them if I tell SQLObject that some non-integer column is the *id* column (via _idName). From your response, however, this is probably not safe. Frank Barknecht wrote: > Hallo, > Jim Vickroy hat gesagt: // Jim Vickroy wrote: > > > May SQLObject be used with a table that has no primary key column (e.g., with a > > table whose key is a combination of columns -- some perhaps being non-integer)? > > Currently no. An integer ID column is mandatory. From the docs: "You > can override the name, but some integer primary key must exist." > > ciao > -- > Frank Barknecht _ ______footils.org__ > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss |
From: Luke O. <lu...@me...> - 2003-08-13 22:30:10
|
The current version of SQLObject only supports integer primary key columns (can use a different name than 'id' using the _idName class attribute). I believe there is a patch to allow non-integer single key columns. There has been a lot of discussion of multi-column primary keys, but I'm not aware of any implementation. There has been no effort towards having tables with *no* primary key constraint, but I don't think that's what you're really wanting. I haven't looked at what it will take to support BLOBs, my guess is a release implementation won't exist until the marshall/unmarshall column code exists (same thing that full BooleanCol support is waiting for). Sorry I can't be more helpful, - Luke Quoting Jim Vickroy <Jim...@no...>: > Thanks for the information. > > Sorry that my question was imprecisely worded. > > May SQLObject be used with a table that has no primary key column (e.g., > with a > table whose key is a combination of columns -- some perhaps being > non-integer)? > > -- jv > > Dave Poirier wrote: > > > On Wed, 2003-08-13 at 13:36, Jim Vickroy wrote: > > > Hello, > > > > > > >From the documentation, it appears that SQLObject is for use with > tables > > > that have an *id* column. May SQLObject be used with tables that do not > > > have an *id* column? > > > > > > Also, a previous post asked about support for BLOBS. Presently, there > > > appears to be no such support. Are there plans to support BLOBS? > > > > > > Thanks, > > > > > > -- jv > > > > Yes, it is possible to name another column as being the primary key. > > > > alternateID: > > > > This boolean (default False) indicates if the column can be used as > > an ID for the field (for instance, a username), though it is not a > > primary key. If so a class method will be added, like byUsername which > > will return that object. Use alternateMethodName if you don't like the > > by* name (e.g. alternateMethodName="username"). > > > > The column should be declared UNIQUE in your table schema. > > > > see http://sqlobject.org/docs/SQLObject.html for further details. > > > > -Dave > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss > -- The Pursuit of Counterfactual Histories |
From: Ian B. <ia...@co...> - 2003-08-20 19:21:23
|
On Wednesday, August 13, 2003, at 04:35 PM, Luke Opperman wrote: > I haven't looked at what it will take to support BLOBs, my guess is a > release > implementation won't exist until the marshall/unmarshall column code > exists > (same thing that full BooleanCol support is waiting for). The elegant implementation will have to wait, but you should still be able to use them now. I posted a message with the subject "Binary Data" today, which kind of outlines it. Ian |