Upcoming API changes & simplification.
slacy opened this issue · 1 comments
Hi, as I continue to use minimongo for my own development, I'm finding that it's a bit limiting when you're subclassing your own models. I can go into more details if you'd like, but the long & short of it is that I'm going to be changing the API and simplifying member access quite a bit.
In addition, I'm planning on using the as_class ability of pymongo itself, which should also simplify the code. What I'm expecting is that the current API of:
DerivedModel.find_one({'query': 'here'})
will change to:
DerivedModel.collection.find_one({'query': 'here'})
and similarly for database methods.
Let me know if you'll have any issues with this conversion or have any other ideas. I'm also going to be supporting dict-like access to returned values from find_one and friends.
Keep your eyes on the repo for more updates.
These changes are done. Please see the commit logs for details. The most significant change is that instead of:
MyDerivedModel.find(...)
you have to say:
MyDerivedModel.collection.find(...)
Cheers!