Add model.fields

Use better naming of field attributes
This commit is contained in:
Cédric Krier committed 2009-02-03 18:58:25 +01:00
1 parent 6f9b7ac07a
commit e28edc4d99
29 files changed
+958 -855

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
#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.fields.field import Field
class Binary(Field):
_type = 'binary'
def get(self, cursor, user, ids, model, name, values=None, context=None):
if values is None:
values = {}
res = {}
for i in values:
res[i['id']] = i[name] and str(i[name]) or None
for i in ids:
res.setdefault(i, None)
return res