equal
deleted
inserted
replaced
205 # submitted, since it will think the attribute is not modified |
205 # submitted, since it will think the attribute is not modified |
206 elif isinstance(value, unicode): |
206 elif isinstance(value, unicode): |
207 # file modified using a text widget |
207 # file modified using a text widget |
208 encoding = entity.attr_metadata(attr, 'encoding') |
208 encoding = entity.attr_metadata(attr, 'encoding') |
209 value = Binary(value.encode(encoding)) |
209 value = Binary(value.encode(encoding)) |
210 else: |
210 elif value: |
211 # value is a 3-uple (filename, mimetype, stream) |
211 # value is a 3-uple (filename, mimetype, stream) |
212 val = Binary(value[2].read()) |
212 val = Binary(value[2].read()) |
213 if not val.getvalue(): # usually an unexistant file |
213 if not val.getvalue(): # usually an unexistant file |
214 value = None |
214 value = None |
215 else: |
215 else: |