This is indeed a strange behavior. This append when you recreate the
documents and register
them another time. A best practice is to register models only once.
This should fix your issue.
But this is a bug and I'm investigating to get ride of it.
Thanks for the report anyway !
Hi,
This is indeed a strange behavior. This append when you recreate the
documents and register
them another time. A best practice is to register models only once.
This should fix your issue.
But this is a bug and I'm investigating to get ride of it.
Thanks for the report anyway !
If you remove all your classes in test2.py and replace them by `from
test1 import *`, the test doesn't crash...
I found where is the problem : when you declare and instantiate your
objects for the first time, the `_make_reference` method is called and
transforms all Document with the custom type `R`. When processing the
document with the `_process_custom_type()` method, all `R` objects are
proceed and the conversion DBRef <-> Document is done.
The issue here is while you redeclare all you class, `_make_reference`
is not called (because no Document are created) and Document are not
convert into a R object (so it can not be proceed by
`_process_custom_type`).
I have to found a solution but it is not easy at all. For the moment,
I suggest you to declare you classes only once into a module and make
import in order to use them.
I'll keep you in touch when I'll find a solution.
yep, but you redeclared all your classes in the test1.py and test2.py.
If you remove all your classes in test2.py and replace them by `from
test1 import *`, the test doesn't crash...
Actually I understood very well what you mean :-)
Anyway, I fixed the bug. I comited it in the last tip (at bitbucket)
so you can give it
a shot and tell me if it works now (it should be).
> Guy, as I say before a scripts should be executed one after another. I mean:Actually I understood very well what you mean :-)
> $ python test1.py
> $ python test2.py
Anyway, I fixed the bug. I comited it in the last tip (at bitbucket)
so you can give it
a shot and tell me if it works now (it should be).
namlook@nichjo:/tmp$ python test1.py
{'owner': {u'company': {u'_id': ObjectId('4b7574f390bce72b4d000000'),
u'name': u'Company'}, u'password': u'test', u'email':
u'man...@test.com', u'_id': ObjectId('4b7574f490bce72b4d000001')},
'token': u'asddadsad', '_id': ObjectId('4b7574f490bce72b4d000002')}
namlook@nichjo:/tmp$ python test2.py
{u'owner': {u'company': {u'_id': ObjectId('4b7574f390bce72b4d000000'),
u'name': u'Company'}, u'password': u'test', u'email':
u'man...@test.com', u'_id': ObjectId('4b7574f490bce72b4d000001')},
u'token': u'asddadsad', u'_id': ObjectId('4b7574f490bce72b4d000002')}
Did you pull and update the lasted tip from bitbucket ?
On Fri, Feb 12, 2010 at 4:19 PM, Andrew Degtiariov
I don't understand, it work fine with pymongo 1.4 :
Well, a lot of bugs have been fixed so I can release version 0.5.3
tomorrow if you really need to.
Enjoy ! :-)
2010/2/13 Nicolas Clairon <cla...@gmail.com>:
--
Flavio Percoco Premoli, A.K.A. [Flaper87]
http://www.flaper87.org
Usuario Linux registrado #436538
Geek by nature, Linux by choice, Archer of course.
Key Fingerprint: CFC0 C67D FF73 463B 7E55 CF43 25D1 E75B E2DB 15C7
The Solution to everything:
python -c "from struct import pack; print pack('5b', (41*len('99')),
pow(8,2)+20, 4900**0.5, range(78)[-1], 10)"