Ticket #479 (closed enhancement: fixed)
GAE Adapter improvements
| Reported by: | nick | Owned by: | nick |
|---|---|---|---|
| Priority: | blocker | Milestone: | 0.4.1 |
| Component: | Adapter | Version: | 0.4 |
| Keywords: | gae | Cc: | |
| Fixed in revision: | Branch: | ||
| Author: |
Description
As it stands the GAE adapter fetches each instance from the datastore if the KEY_ATTR attribute is supplied with the encoded instance. This happens even if the object has been fetched before, incurring a get request. This is obviously stupid; an index on the encoder's context should be created and consulted before fetching from the datastore.
When encoding objects PyAMF follows db.ReferenceProperty attributes (as it should) however, to encode the object, it is first fetched from the datastore (all fine so far). The 'problem' occurs when say a number of Novel objects have a reference to the same Author object. PyAMF will fetch the Author object from the datastore each time it is encountered. We could use the same context index to see if the instance has already been fetched.


