DAL question

48 views
Skip to first unread message

Niphlod

unread,
Oct 18, 2013, 4:00:57 PM10/18/13
to web2py-d...@googlegroups.com
Hi all. Does anyone has a good reason to NOT change this line

https://github.com/web2py/web2py/blob/master/gluon/dal.py#L1255

to

if not isinstance(id,(int, long))

?

For some obscure reason, when the datatype for inserts and such got "long"s all the way, this remained untouched....

I'm asking 'cause I'm testing the DAL with MSSQL and this makes them fail, cause the last_insert_id in MSSQL is always returned as a "long", but when you do
id = db.person.insert(name='whatever')

you just get back the "long" without the reference attached to make this work

id.name == 'whatever'

Niphlod

unread,
Oct 20, 2013, 1:26:42 PM10/20/13
to web2py-d...@googlegroups.com
Anyone ?

Jan-Karel Visser

unread,
Oct 20, 2013, 1:39:19 PM10/20/13
to web2py-d...@googlegroups.com
Tested it (slightly). I don't see any problems for other db's. Go for it.


2013/10/20 Niphlod <nip...@gmail.com>

--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Massimo DiPierro

unread,
Oct 20, 2013, 2:03:09 PM10/20/13
to web2py-d...@googlegroups.com
I thought I responded. I am ok with the change.

Niphlod

unread,
Oct 20, 2013, 3:03:35 PM10/20/13
to web2py-d...@googlegroups.com
ok, then as soon as the PR for rname gets in, I'll send another one with this fix.

BTW: with that correction DAL tests for MSSQL and rname are passing with flying colors.

Niphlod

unread,
Oct 21, 2013, 5:20:17 PM10/21/13
to web2py-d...@googlegroups.com
PR sent

Jan-Karel Visser

unread,
Oct 21, 2013, 6:14:09 PM10/21/13
to web2py-d...@googlegroups.com
jottum


2013/10/21 Niphlod <nip...@gmail.com>

Niphlod

unread,
Oct 22, 2013, 3:28:49 AM10/22/13
to web2py-d...@googlegroups.com
in english ? :D

jottum

Reply all
Reply to author
Forward
0 new messages