I really need a second paid of eyes

70 views
Skip to first unread message

Massimo DiPierro

unread,
Mar 19, 2016, 2:40:50 PM3/19/16
to web2py-developers
https://github.com/web2py/web2py/commit/ec3ae8211f365cf10ea1fff6b71ffee041231b7e

I do not remember the reason for the previous logic. It seems correct now. what corner cases am I missing?

Leonel Câmara

unread,
Mar 20, 2016, 8:18:08 AM3/20/16
to web2py-developers
I don't get it, why can't unique fields be empty?

Massimo DiPierro

unread,
Mar 20, 2016, 12:19:59 PM3/20/16
to web2py-d...@googlegroups.com
I checked that code and works well for me. 
Can a unique field be empty? I think it should not. Because only one record would be able to be empty or else it would not be unique and this gives rite to usability issues.
 
On Mar 20, 2016, at 7:18 AM, Leonel Câmara <leonel...@gmail.com> wrote:

I don't get it, why can't unique fields be empty?

--
-- 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/d/optout.

Niphlod

unread,
Mar 21, 2016, 10:06:59 AM3/21/16
to web2py-developers
from a SQL guy, technically a field can have a unique constraint and still allow multiple NULL rows. 

Richard Vézina

unread,
Mar 21, 2016, 10:30:09 AM3/21/16
to web2py-d...@googlegroups.com
Simone is right, but not sure how to reproduce this behavior in python... Little search didn't provide any hint...

Richard

Richard Vézina

unread,
Mar 21, 2016, 3:16:32 PM3/21/16
to web2py-d...@googlegroups.com

Massimo DiPierro

unread,
Mar 21, 2016, 3:19:38 PM3/21/16
to web2py-d...@googlegroups.com
we are talking about validators and therefore empty strings in a unique field. Should a empty string be allowed in an empty field? Technically yes but it is a usability thing. Only one row could be empty and users may think it is valid but only the first time. I do not think a empty string should be valued for a unique field.

Richard Vézina

unread,
Mar 21, 2016, 3:25:42 PM3/21/16
to web2py-d...@googlegroups.com
I think that if we can't make it works like SQL works (NULL != NULL = True) than it should not allow empty string...

Anthony

unread,
Mar 21, 2016, 3:32:50 PM3/21/16
to web2py-developers
On Monday, March 21, 2016 at 3:19:38 PM UTC-4, Massimo Di Pierro wrote:
we are talking about validators and therefore empty strings in a unique field. Should a empty string be allowed in an empty field? Technically yes but it is a usability thing. Only one row could be empty and users may think it is valid but only the first time. I do not think a empty string should be valued for a unique field.

But this is for the purpose of determining default validators, no? Maybe we should just leave this one up to the developer? (Though I don't have a strong opinion either way.)

Anthony

Massimo DiPierro

unread,
Mar 21, 2016, 3:41:03 PM3/21/16
to web2py-d...@googlegroups.com
No we cannot because an empty string is not NULL.

Massimo DiPierro

unread,
Mar 21, 2016, 3:41:52 PM3/21/16
to web2py-d...@googlegroups.com
this is just for building default validators in a sane way. Developer can change it.

Reply all
Reply to author
Forward
0 new messages