Files
tryton/trytond/model/fields/binary.py
T
Cédric Krier e28edc4d99 Add model.fields
Use better naming of field attributes
2009-02-03 18:58:25 +01:00

19 lines
541 B
Python

#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