Use Null constant from python-sql for comparisons

issue4143
review13701003
This commit is contained in:
Robin Baumgartner
2014-11-24 14:01:34 +01:00
parent 24acc7b93c
commit eb0c4c087e
3 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
'Address'
from sql import Null
from trytond.model import ModelView, ModelSQL, fields
from trytond.pyson import Eval, If
from trytond.transaction import Transaction
@@ -61,7 +63,7 @@ class Address(ModelSQL, ModelView):
@staticmethod
def order_sequence(tables):
table, _ = tables[None]
return [table.sequence == None, table.sequence]
return [table.sequence == Null, table.sequence]
@staticmethod
def default_active():
+3 -1
View File
@@ -1,5 +1,7 @@
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
from sql import Null
from trytond.model import ModelView, ModelSQL, fields
from trytond.pyson import Eval
from trytond.transaction import Transaction
@@ -102,7 +104,7 @@ class ContactMechanism(ModelSQL, ModelView):
@staticmethod
def order_sequence(tables):
table, _ = tables[None]
return [table.sequence == None, table.sequence]
return [table.sequence == Null, table.sequence]
@staticmethod
def default_type():
+1 -1
View File
@@ -41,7 +41,7 @@ if minor_version % 2:
'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % (
name[8:], name, version))
requires = ['python-sql']
requires = ['python-sql >= 0.4']
for dep in info.get('depends', []):
if not re.match(r'(ir|res|webdav)(\W|$)', dep):
requires.append(get_require_version('trytond_%s' % dep))