neo4j/python-embedded — Issue #18: Properties can't handle Decimal
Author: johanlundberg
Created: 2012-03-09 11:49:45+00:00
State: open

I don't even know if this is something that we want but I'lll post it as a reference if someone makes the same choice/mistake as I did.

When using DecimalFields in Django I got tracebacks after upgrading to neo4j-embedded 1.6.1. It turns out that the fix is easy, use FloatFields instead. :)

´´´python
In [6]: from decimal import Decimal

In [7]: decimal = Decimal("3.14")

In [8]: with neo4jdb.transaction:
neo4jdb.reference_node['decimal'] = decimal
...:
...:
---------------------------------------------------------------------------
Exception Traceback (most recent call last)

/home/lundberg/norduni/src/niweb/ in ()

/usr/local/lib/python2.6/dist-packages/neo4j/core.pyc in __setitem__(self, key, value)
89
90 def __setitem__(self, key, value):
---> 91 self.set(key, value)
92
93 def __delitem__(self, key):

/usr/local/lib/python2.6/dist-packages/neo4j/core.pyc in set(self, key, value)
111 self.setProperty(key, to_java(value))
112 except:
--> 113 rethrow_current_exception_as(Exception)
114
115 def items(self):

/usr/local/lib/python2.6/dist-packages/neo4j/core.pyc in set(self, key, value)
109 self.__delitem__(key)
110 else:
--> 111 self.setProperty(key, to_java(value))
112 except:
113 rethrow_current_exception_as(Exception)

/usr/local/lib/python2.6/dist-packages/neo4j/_backend.pyc in decorator(*args, **kwargs)
154 if not jpype.isThreadAttachedToJVM():
155 jpype.attachThreadToJVM()
--> 156 return fn(*args, **kwargs)
157 return decorator
158

Exception: No matching overloads found. at src/native/common/jp_method.cpp:121
´´´