Don't try to read Binary field for non-saved records

This commit is contained in:
Cédric Krier
2011-10-04 19:13:23 +02:00
parent a2f82a87c9
commit 7a7612523f
@@ -828,6 +828,8 @@ class BinaryField(CharField):
def get_data(self, record):
if not isinstance(record.value.get(self.name), (basestring, buffer)):
if record.id < 0:
return ''
ctx = rpc.CONTEXT.copy()
ctx.update(record.context_get())
rpcprogress = RPCProgress('execute', ('model', record.model_name,