Please review this at http://codereview.appspot.com/190095/show
Affected files:
A trytond/const.py
M trytond/model/fields/field.py
M trytond/model/modelsql.py
M trytond/model/modelstorage.py
Index: trytond/const.py
===================================================================
new file mode 100644
--- /dev/null
+++ b/trytond/const.py
@@ -0,0 +1,19 @@
+#This file is part of Tryton. The COPYRIGHT file at the top level of
+#this repository contains the full copyright notices and license terms.
+
+OPERATORS = (
+ 'child_of',
+ 'not child_of',
+ '=',
+ '!=',
+ 'like',
+ 'not like',
+ 'ilike',
+ 'not ilike',
+ 'in',
+ 'not in',
+ '<=',
+ '>=',
+ '<',
+ '>',
+)
Index: trytond/model/fields/field.py
===================================================================
--- a/trytond/model/fields/field.py
+++ b/trytond/model/fields/field.py
@@ -2,9 +2,9 @@
#this repository contains the full copyright notices and license terms.
from trytond.pyson import PYSON
+from trytond.const import OPERATORS
def domain_validate(value):
- from trytond.model.modelstorage import OPERATORS
assert isinstance(value, list), 'domain must be a list'
def test_domain(dom):
for arg in dom:
Index: trytond/model/modelsql.py
===================================================================
--- a/trytond/model/modelsql.py
+++ b/trytond/model/modelsql.py
@@ -1,12 +1,13 @@
#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 trytond.model import ModelStorage, OPERATORS
+from trytond.model import ModelStorage
from trytond.model import fields
from trytond.backend import FIELDS, TableHandler
from trytond.backend import DatabaseIntegrityError, Database
from trytond.model.browse import BrowseRecord, BrowseRecordNull
from trytond.tools import reduce_ids
+from trytond.const import OPERATORS
import datetime
import re
_RE_UNIQUE = re.compile('UNIQUE\s*\((.*)\)', re.I)
Index: trytond/model/modelstorage.py
===================================================================
--- a/trytond/model/modelstorage.py
+++ b/trytond/model/modelstorage.py
@@ -6,29 +6,13 @@
from trytond.model.browse import EvalEnvironment
from trytond.tools import safe_eval
from trytond.pyson import PYSONEncoder, PYSONDecoder, PYSON
+from trytond.const import OPERATORS
import datetime
import time
from decimal import Decimal
import logging
from itertools import chain
-OPERATORS = (
- 'child_of',
- 'not child_of',
- '=',
- '!=',
- 'like',
- 'not like',
- 'ilike',
- 'not ilike',
- 'in',
- 'not in',
- '<=',
- '>=',
- '<',
- '>',
-)
-
class ModelStorage(Model):
"""
--
Cédric Krier
B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email: [email protected]
Jabber: [email protected]
Website: http://www.b2ck.com/
twitter: http://twitter.com/cedrickrier
identi.ca: http://identi.ca/cedrickrier
pgp5xBOPdH7mi.pgp
Description: PGP signature
