Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Don't raise a property name collision if the colliding alias and ndb properties aren't defined on the same level of the MRO #69

Open
dhermes opened this issue May 3, 2013 · 0 comments

Comments

@dhermes
Copy link
Contributor

dhermes commented May 3, 2013

Don't raise a property name collision if the colliding alias and ndb properties aren't defined on the same level of the MRO

This doesn't occur always, but

from google.appengine.ext import ndb
from endpoints_proto_datastore.ndb import EndpointsModel

class SomeModel(EndpointsModel):
  other_prop = ndb.StringProperty('id')

results in the following exception

Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/devappserver2/python/request_handler.py", line 151, in handle_interactive_request
    exec(compiled_code, self._command_globals)
  File "<string>", line 4, in <module>
  File "/Users/dhermes/endpoints-proto-datastore/examples/simple_get/endpoints_proto_datastore/ndb/model.py", line 459, in __init__
    cls._FixUpAliasProperties()
  File "/Users/dhermes/endpoints-proto-datastore/examples/simple_get/endpoints_proto_datastore/ndb/model.py", line 480, in _FixUpAliasProperties
    raise AttributeError(PROPERTY_COLLISION_TEMPLATE % (attr_name,))
AttributeError: Name conflict: id set as an NDB property and an Endpoints alias property.

while

from google.appengine.ext import ndb
from endpoints_proto_datastore.ndb import EndpointsModel

class SomeModel(EndpointsModel):
  id = ndb.StringProperty()

does not result in an exception.

@ghost ghost assigned dhermes May 3, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant