On Tue, Dec 22, 2015 at 02:19:12PM -0500, Nathan Edwards <n...@georgetown.edu> 
wrote:
> On 12/22/2015 1:28 PM, Oleg Broytman wrote:
> > On Tue, Dec 22, 2015 at 12:50:09PM -0500, Nathan Edwards 
> > <n...@georgetown.edu> wrote:
> class B(SQLObject):
>     anInt = IntCol()
>     afk = ForeignKey("A")
...
> # This succeeds and is inserted to sqlite database!
> b = B(anInt=4,afk='Strange!')
> 
> >    He-he. Yes, that a wart but it's hard to fix. The PRIMARY KEY (id)
> > column in a referenced table can be of string type[1] so ForeignKey
> > allows both ints and strings (a ForeignKey doesn't know the type of the
> > id column it points to).
> 
> Hmmm. I thought this was probably the rationale.

   Not at all. ForeignKeys just don't do any validation or conversion.
Would be worth fixing.

> 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.

> Thanks,
> 
> - n
> 
> -- 
> Dr. Nathan Edwards                      n...@georgetown.edu
> Department of Biochemistry and Molecular & Cellular Biology
>             Georgetown University Medical Center
>                 Room 1217, Harris Building,
>         3300 Whitehaven St, NW, Washington DC 20007
>            Phone: 202-687-7042, Fax: 202-687-0057

Oleg.
-- 
     Oleg Broytman            http://phdru.name/            p...@phdru.name
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to