Re: [SQLObject] Strange ForeignKey behavior...

2015-12-23 Thread Oleg Broytman
On Wed, Dec 23, 2015 at 11:09:35PM +0100, Oleg Broytman wrote: > 1. Postgres. Until now SQLObject used to create ForeignKeys of type > idType of the current table, i.e. usually INT. I fixed that (by adding a > lookup of idType of the referenced table), but that a big > backward-incompatible change

Re: [SQLObject] Strange ForeignKey behavior...

2015-12-23 Thread Oleg Broytman
On Wed, Dec 23, 2015 at 08:35:10PM +0100, Oleg Broytman wrote: > Hi! > On Wed, Dec 23, 2015 at 12:09:27PM -0500, Nathan Edwards > wrote: > > > > >> I'll see if I can figure out a minimalist patch to > > >> propose... > > > > > >Eagerly waiting! But if you don't succeed notify me -- I'll at

Re: [SQLObject] Strange ForeignKey behavior...

2015-12-23 Thread Oleg Broytman
Hi! On Wed, Dec 23, 2015 at 12:09:27PM -0500, Nathan Edwards wrote: > > >> I'll see if I can figure out a minimalist patch to > >> propose... > > > >Eagerly waiting! But if you don't succeed notify me -- I'll at least > > add a TODO item. > > Not sure if this will be up to your coding sta

Re: [SQLObject] Strange ForeignKey behavior...

2015-12-23 Thread Nathan Edwards
>> I'll see if I can figure out a minimalist patch to >> propose... > >Eagerly waiting! But if you don't succeed notify me -- I'll at least > add a TODO item. Not sure if this will be up to your coding standards, but here is an attempt - it uses the validator infrastructure to attempt conver

Re: [SQLObject] Strange ForeignKey behavior...

2015-12-22 Thread Oleg Broytman
On Tue, Dec 22, 2015 at 02:19:12PM -0500, Nathan Edwards wrote: > On 12/22/2015 1:28 PM, Oleg Broytman wrote: > > On Tue, Dec 22, 2015 at 12:50:09PM -0500, Nathan Edwards > > wrote: > class B(SQLObject): > anInt = IntCol() > afk = ForeignKey("A") ... > # This succeeds and is inserted to

Re: [SQLObject] Strange ForeignKey behavior...

2015-12-22 Thread Nathan Edwards
Thanks for the quick response Oleg... On 12/22/2015 1:28 PM, Oleg Broytman wrote: > Hi! > > On Tue, Dec 22, 2015 at 12:50:09PM -0500, Nathan Edwards > wrote: >> >> A number of my students used some form of the ForeignKey abuse shown >> below. The first one B(anInt=2,afk=a.id) is pretty benign

Re: [SQLObject] Strange ForeignKey behavior...

2015-12-22 Thread Oleg Broytman
Hi! On Tue, Dec 22, 2015 at 12:50:09PM -0500, Nathan Edwards wrote: > > A number of my students used some form of the ForeignKey abuse shown > below. The first one B(anInt=2,afk=a.id) is pretty benign (though > unnecessary), but the really strange one is B(anInt=4,afk='Strange!'). > At least wi

[SQLObject] Strange ForeignKey behavior...

2015-12-22 Thread Nathan Edwards
A number of my students used some form of the ForeignKey abuse shown below. The first one B(anInt=2,afk=a.id) is pretty benign (though unnecessary), but the really strange one is B(anInt=4,afk='Strange!'). At least with sqlite3 as the backend, this is stored in the database as a string (), eve