I have a simple (SQLite) Table named *test_table*, and a simple Field 
called "test_field" like so:

db.define_table('test_table',
    Field('test_field')
)


Now when I populate this table in shell (or the app), and I try to do a 
query with (!=), something very weird and unexpected happens...

*web2py Web Framework*
*Created by Massimo Di Pierro, Copyright 2007-2016*
*Version 2.14.5-stable+timestamp.2016.04.14.03.26.16*
*Database drivers available: pymysql, imaplib, sqlite3, pg8000, pyodbc, 
pymongo*
*2016-04-23 13:27:01,023 - web2py - WARNING - import IPython error; use 
default python shell*
*Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] 
on win32*
*Type "help", "copyright", "credits" or "license" for more information.*
*(InteractiveConsole)*
>>> db.test_table.insert()
1L
>>> db.test_table.insert()
2L
*>>> db(db.test_table.test_field != "test_string").count()*
*0*
>>> db(db.test_table.id > 0).count()
2

Am I crazy, or shouldn't the first query result in *2 as well*? Note, the query 
seems to work perfectly fine if I set the test_field's default value to an 
empty string (""). 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to