Code Monkey home page Code Monkey logo

endpoints-proto-datastore's Issues

Discussion: Does it make sense to include Computed properties in default schema?

Including computed properties in default ordering may be a bad idea, since they can't be set.

However, since we override _set_value to just warn and do nothing, this may not be as big an issue, though it will mislead API callers.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2012-12-06T17:40:24.000Z

Code Hosting Issue Metadata:
published=2012-12-06T17:40:24.000Z
stars=1
updated=2013-01-18T06:48:45.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=12
author=@dhermes

Add sample with a custom NDB property --> ProtoRPC field mapping in registry

Add sample with a custom NDB property --> ProtoRPC field mapping in registry



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2012-12-10T17:08:01.000Z

Code Hosting Issue Metadata:
published=2012-12-10T17:08:01.000Z
stars=1
updated=2012-12-11T20:02:45.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=17
author=@dhermes

Allow distinct request and response type in toplevel method decorator

It would be nice if the top level method decorator could support distinct combination of ndb.Model or Query as request and response parameter.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/118023969811374967961/
author.name=[email protected]
id=0
published=2012-12-06T21:35:04.000Z

Code Hosting Issue Metadata:
published=2012-12-06T21:35:04.000Z
stars=2
updated=2012-12-11T20:05:01.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=13
author=@proppy
cc=[
  @proppy,
]

Consider renaming entity attr from_datastore

This is used to denote whether or not an entity has values that were retrieved from the datastore. Example usage:

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2012-12-11T23:24:54.000Z

Code Hosting Issue Metadata:
published=2012-12-11T23:24:54.000Z
stars=1
updated=2013-01-18T06:51:28.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=20
author=@dhermes
cc=[
  @fredsa,
]

Make TransformModel less ambiguous for introduction page/project landing page

In the code hosting langing page:
https://github.com/GoogleCloudPlatform/endpoints-proto-datastore/blob/master/README.md
(Was previously http://code.google.com/p/endpoints-proto-datastore/)

and the docs main page

https://github.com/GoogleCloudPlatform/endpoints-proto-datastore/blob/master/docs/index.html
http://endpoints-proto-datastore.appspot.com/

the statement

transformed_model = TransformModel(my_model)

is misleading.

Add a definition of TransformModel somewhere or indicate that it is not defined here but something a user may define.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-01-16T00:31:50.000Z

Code Hosting Issue Metadata:
published=2013-01-16T00:31:50.000Z
stars=1
updated=2013-01-25T23:07:13.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=34
author=@dhermes
cc=[
  @fredsa,
]

Add sample with custom ProtoRPC message class

Add sample with custom ProtoRPC message class for request/response in MyModel.method

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2012-12-10T17:10:40.000Z

Code Hosting Issue Metadata:
published=2012-12-10T17:10:40.000Z
stars=1
updated=2012-12-11T20:02:50.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=18
author=@dhermes

Make the link to the repository more obvious

Right now there is a link to the specific folder but not to the actual repository. It would be better to have a called-out link to the repository at the beginning of the guide (think Github Ribbon.)



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/104392738264586850178/
author.name=[email protected]
id=0
published=2012-12-21T20:24:42.000Z

Code Hosting Issue Metadata:
published=2012-12-21T20:24:42.000Z
stars=2
updated=2012-12-23T21:47:21.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=26
author=@beriberikix
cc=[
  @beriberikix,
]

Missing required properties in inserts should raise endpoints.BadRequestException

What steps will reproduce the problem?

  1. Create a model with a property set to required=true
  2. Create an insert method for this model
  3. Call model.insert without the required property

What is the expected output? What do you see instead?
It would be nice if that would raise an endpoints.BadRequestException.
At the moment the result is a 503 Server Error.

Please provide any additional information below.
It is easily possible to handle that in the model.insert method myself, but since forgetting fields in API requests is I think a very common mistake it would be awesome to have it directly handled by the library :)

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/112336147904981294875/
author.name=scarygami
id=0
published=2013-04-07T12:53:37.000Z

Code Hosting Issue Metadata:
published=2013-04-07T12:53:37.000Z
stars=2
updated=2013-04-18T21:55:46.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=56
author=@Scarygami

Fix class referenced in structured property error and make the error more informative.

The following example raises

TypeError: Structured properties must receive a model class with a callable ProtoModel attribute. The class Model has no such attribute.

model.py

class Person(ndb.Model):                                                        
  first_name = ndb.StringProperty()                                             
  last_name = ndb.StringProperty()                                              

class DirectoryEntry(EndpointsModel):                                           
  created = ndb.DateTimeProperty(indexed=False, auto_now_add=True)              
  authorized_emails = ndb.StringProperty(repeated=True)                         
  parents = ndb.StructuredProperty(Person, repeated=True)                       
  children = ndb.StructuredProperty(Person, repeated=True) 

api.py

@endpoints.api(name='directory', version='v1',                                  
               description='My School Directory API',                           
               allowed_client_ids=[                                             
                   endpoints.API_EXPLORER_CLIENT_ID,                            
                   CLIENT_ID,                                                   
               ],                                                               
               scopes=[SCOPE_EMAIL],                                            
              )                                                                 
class DirectoryApi(remote.Service): 

  @DirectoryEntry.method(path='directoryentry',                                 
                         name='directoryentry.put',                             
                        )                                                       
  def DirectoryEntryPut(self, directory_entry):                                 
    directory_entry.put()                                                       
    return directory_entry  

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/fredsa/
author.name=fredsa
id=0
published=2013-01-26T21:29:22.000Z

Code Hosting Issue Metadata:
published=2013-01-26T21:29:22.000Z
stars=2
updated=2013-02-04T21:06:37.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=40
author=@fredsa

repeated=True property causes BadValueError (Expected string, got [])

model.py

class DirectoryEntry(EndpointsModel):                                           
  created = ndb.DateTimeProperty(indexed=False, auto_now_add=True)              
  authorized_emails = ndb.StringProperty(repeated=True) 

api.py

@endpoints.api(name='directory', version='v1',                                  
               description='My School Directory API',                           
               allowed_client_ids=[                                             
                   endpoints.API_EXPLORER_CLIENT_ID,                            
                   CLIENT_ID,                                                   
               ],                                                               
               scopes=[SCOPE_EMAIL],                                            
              )                                                                 
class DirectoryApi(remote.Service):                                             

  @DirectoryEntry.query_method(path='directoryentry',                           
                               name='directoryentry.query',                     
                               user_required=True,                              
                              )                                                 
  def DirectoryEntryQuery(self, query):                                         
    return query 

app = endpoints.api_server([DirectoryApi], restricted=True)                     

dev_appserver logs:

ERROR    2013-02-03 02:05:37,442 service.py:196] Encountered unexpected error from ProtoRPC method implementation: BadValueError (Expected string, got [])
INFO     2013-02-03 02:05:37,460 dev_appserver.py:3103] "POST /_ah/api/rpc HTTP/1.1" 500 -

endpoints-proto-datastore version

$ git submodule
 5ccd11bbeb78b05cb093986d3977834f6630b41e endpoints-proto-datastore (heads/master)

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/fredsa/
author.name=fredsa
id=0
published=2013-02-03T02:09:36.000Z

Code Hosting Issue Metadata:
mergedInto.issueId=33
mergedInto.projectId=endpoints-proto-datastore
published=2013-02-03T02:09:36.000Z
stars=1
updated=2013-02-04T21:40:39.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=44
author=@fredsa
owner.htmlLink=

If a string ID is set for the integer id EndpointsAliasProperty, the getter should throw an exception

If a string ID is set for the integer id EndpointsAliasProperty, the getter should throw an exception

i.e. instead of

self._key.integer_id()

we would use

self._key.id()

and throw an exception if this value wasn't None or (int, long).

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-01-16T23:18:51.000Z

Code Hosting Issue Metadata:
published=2013-01-16T23:18:51.000Z
stars=1
updated=2013-02-28T01:50:55.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=36
author=@dhermes
cc=[
  @fredsa,
]

Add Sample that uses StructuredProperty

Add Sample that uses StructuredProperty

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-02-01T17:46:21.000Z

Code Hosting Issue Metadata:
published=2013-02-01T17:46:21.000Z
stars=1
updated=2013-02-01T17:46:21.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=41
author=@dhermes
cc=[
  @fredsa,
]

Make _EndpointsQueryInfo a customizable attribute of EndpointsModel rather than a constant class

(Discussion rather than feature request)

Make _EndpointsQueryInfo a customizable attribute of EndpointsModel rather than a constant class

In other words, rather than the current state:

self._endpoints_query_info = _EndpointsQueryInfo(self) 

we would have

self._endpoints_query_info = self.custom_query_info_class(self)

where self.custom_query_info_class comes from the class itself.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-02-22T06:51:29.000Z

Code Hosting Issue Metadata:
published=2013-02-22T06:51:29.000Z
stars=2
updated=2013-02-22T06:51:29.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=50
author=@dhermes

Discussion: Should EndpointsUserProperty allow itself to be set?

Discussion: Should EndpointsUserProperty allow itself to be set?

Is it more intuitive to have the property always implicitly set by the environment?

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2012-11-29T22:11:26.000Z

Code Hosting Issue Metadata:
published=2012-11-29T22:11:26.000Z
stars=1
updated=2012-11-29T22:11:26.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=10
author=@dhermes

_message_fields_schema from parent class is not used

In the following example, _message_fields_schema is not used in either of the child classes, causing the 'id' key field to not be included in RPCs.

class Person(EndpointsModel):                                                   
   # adding 'id' gives us key.id()                                              
   _message_fields_schema = ('email', 'first_name', 'last_name', 'created', 'id')

   email = ndb.StringProperty()                                                 
   first_name = ndb.StringProperty(indexed=False)                               
   last_name = ndb.StringProperty(indexed=False)                                
   created = ndb.DateTimeProperty(indexed=False, auto_now_add=True)             

class ParentGuardian(Person):                                                   
  pass

class Child(Person):                                                            
  pass

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/fredsa/
author.name=fredsa
id=0
published=2013-01-26T20:08:15.000Z

Code Hosting Issue Metadata:
published=2013-01-26T20:08:15.000Z
stars=2
updated=2013-02-18T04:50:39.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=38
author=@fredsa

Add sample which explicitly deals with _EndpointsQueryInfo

Add sample which explicitly deals with _EndpointsQueryInfo and nothing else, to indicate how to use this.

May help to extend it first per Issue #59 and Issue #55.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2012-12-12T00:28:50.000Z

Code Hosting Issue Metadata:
published=2012-12-12T00:28:50.000Z
stars=2
updated=2012-12-12T00:28:50.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=22
author=@dhermes

Provide sample cURL requests & api explorer links

While I was able to figure out the API route, it wasn't crystal clear. It would have been easier to have cURL commands to copy and paste as well as a link to the API Explorer where it makes sense (like the basic auth example.)



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/104392738264586850178/
author.name=[email protected]
id=0
published=2012-12-22T23:39:49.000Z

Code Hosting Issue Metadata:
published=2012-12-22T23:39:49.000Z
stars=2
updated=2012-12-23T21:47:02.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=28
author=@beriberikix

Use message_type instead of type for ProtoRPC message fields

This was changed in
https://code.google.com/p/google-protorpc/source/detail?r=fdfa1f57c28fbae2bd1cfa21545d10ae7c6cb523

to allow support for things like date time fields.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-03-26T16:08:26.000Z

Code Hosting Issue Metadata:
published=2013-03-26T16:08:26.000Z
stars=1
updated=2013-03-26T16:08:26.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=54
author=@dhermes
cc=[
  @kdeus,
]

Allow model.method to be fully transactional

Allow model.method to be fully transactional

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2012-12-20T17:30:12.000Z

Code Hosting Issue Metadata:
published=2012-12-20T17:30:12.000Z
stars=1
updated=2013-01-10T22:22:46.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=24
author=@dhermes
cc=[
  @fredsa,
]

Consider adding a Google Group for code reviews

As in http://code.google.com/p/appengine-ndb-experiment/wiki/Contributing

There is a note about using

with upload.py and also

Make sure you're subscribed to appenine-ndb-discuss or else notification to group may bounce.

It may be worth creating such a group for development here as well.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2012-12-11T02:29:12.000Z

Code Hosting Issue Metadata:
published=2012-12-11T02:29:12.000Z
stars=4
updated=2013-03-03T23:06:20.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=19
author=@dhermes

Add sample with custom schema name/one that uses MessageFieldsSchema

Add sample with custom schema name/one that uses MessageFieldsSchema:

class MessageFieldsSchema(object):

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2012-12-12T00:13:14.000Z

Code Hosting Issue Metadata:
published=2012-12-12T00:13:14.000Z
stars=1
updated=2013-01-18T06:55:03.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=21
author=@dhermes

Add script to make endpoints_proto_datastore.zip

To make endpoints_proto_datastore.zip for Downloads:
http://code.google.com/p/endpoints-proto-datastore/downloads/detail?name=endpoints_proto_datastore.zip

I used a script and I'm not sure if it's worth adding or not. Contents here:

import os
import subprocess
import zipfile


FILES = [
    'endpoints_proto_datastore/__init__.py',
    'endpoints_proto_datastore/ndb/__init__.py',
    'endpoints_proto_datastore/ndb/model.py',
    'endpoints_proto_datastore/ndb/properties.py',
    'endpoints_proto_datastore/ndb/utils.py',
    'endpoints_proto_datastore/utils.py',
]


def main():
  git_root_process = subprocess.Popen(['git', 'rev-parse', '--show-toplevel'],
                                      stdout=subprocess.PIPE)
  git_root_process.wait()
  git_root = git_root_process.stdout.read().strip()
  print 'Process changing directory to', git_root
  os.chdir(git_root)

  with zipfile.ZipFile('endpoints_proto_datastore.zip', 'w') as library_zip:
    for filename in FILES:
      print 'Writing', filename
      library_zip.write(filename)


if __name__ == '__main__':
  main()

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-02-18T03:24:20.000Z

Code Hosting Issue Metadata:
published=2013-02-18T03:24:20.000Z
stars=1
updated=2013-02-18T03:24:20.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=45
author=@dhermes

Document _custom_property_to_proto and the other behavior in _VerifyProtoMapping

Document _custom_property_to_proto and the other behavior in _VerifyProtoMapping

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-04-05T17:44:10.000Z

Code Hosting Issue Metadata:
published=2013-04-05T17:44:10.000Z
stars=2
updated=2013-04-05T17:44:10.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=55
author=@dhermes
cc=[
  @Scarygami,
]

Discussion: Is it worth making EndpointsAliasProperty behave like the native @property in Python?

Discussion: Is it worth making EndpointsAliasProperty behave like the native @property in Python?

Things like

class A(object):
  @property
  def b(self):
    ...
  @b.setter
  def b(self, value):
    ...

are possible to do and may make use of EndpointsAliasProperty easier to understand/more palatable.

MAGNETS: HOW DO THEY WORK?
The @b.setter magic is implemented relatively simply by just replacing 'b' in the __dict__ for the class A with a new property instance. (property is actually just a class.) The old property defined via

  @property
  def b(self):
    ...

just gets orphaned and the new one copies over everything from the old one, and in the b.setter case, updates the fset value in the copy of the property instance. Similar behavior between the pairs (deleter, fdel) and (getter, fget) occurs as well.

SAMPLE IMPLEMENTATION:

class pproperty(object):
  def __init__(self, fget, fset=None, fdel=None, doc=None):
    self.fget = fget
    self.fset = fset
    self.fdel = fdel
    self.doc = doc or fget.__doc__
    self.__staged_getters = []
    self.__staged_setters = []
    self.__staged_deleters = []
  def __get__(self, instance, owner):
    if instance:
      return self.fget(instance)
    else:
      return self
  def __set__(self, instance, value):
    if self.fset:
      self.fset(instance, value)
    else:
      raise AttributeError('can\'t set attribute')
  def __delete__(self, instance):
    if self.fdel:
      self.fdel(instance)
    else:
      raise AttributeError('can\'t delete attribute')
  def copy(self, **override_kwargs):
    curr_kwargs = {
        'fget': self.fget,
        'fset': self.fset,
        'fdel': self.fdel,
        'doc': self.doc,
    }
    curr_kwargs.update(override_kwargs)
    return self.__class__(**curr_kwargs)
  def getter(self, fget):
    return self.copy(fget=fget)
  def setter(self, fset):
    return self.copy(fset=fset)
  def deleter(self, fdel):
    return self.copy(fdel=fdel)

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-03-04T21:35:10.000Z

Code Hosting Issue Metadata:
published=2013-03-04T21:35:10.000Z
stars=1
updated=2013-03-11T17:51:36.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=53
author=@dhermes
cc=[
  @fredsa,
]

Differing name and code_name on properties cause ToMessage to fail

Differing name and code_name on properties cause ToMessage to fail.

Example:

class MyModel(EndpointsModel):
  local = ndb.StringProperty('persist')
my_model = MyModel(local='10')
my_msg = my_model.ToMessage()

causes the stack trace

/tmp/python-1773976H.py in <module>()
     19   pass
     20 my_model = MyModel(local='10')
---> 21 my_msg = my_model.ToMessage()
     22 
     23 # fields = None

/usr/local/google/home/dhermes/endpoints-proto-datastore/endpoints_proto_datastore/ndb/model.pyc in ToMessage(self, fields)
   1072       # Since we are using getattr rather than checking self._values, this will
   1073       # also work for properties which have a default set
-> 1074       value = getattr(self, name)
   1075       if value is None:
   1076         continue

AttributeError: 'MyModel' object has no attribute 'persist'

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-02-21T22:51:58.000Z

Code Hosting Issue Metadata:
published=2013-02-21T22:51:58.000Z
stars=1
updated=2013-02-22T01:36:27.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=48
author=@dhermes

Fix bug around repeated properties in _EndpointsQueryInfo

In _EndpointsQueryInfo._PopulateFilters, adding filters ignores repeated properties; this was an oversight on my part.

For the time being, _AddFilter doesn't support anything other than equality filters, but eventually it may be possible to solve this with an IN filter.

Until a full fix is in place, the following patch will suffice:

  if prop._repeated:
    if current_value != []:
      raise ValueError('No queries on repeated values are allowed.')
    continue

where this is called just before if current_value is not None

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-01-11T08:23:54.000Z

Code Hosting Issue Metadata:
published=2013-01-11T08:23:54.000Z
stars=4
updated=2013-02-23T00:34:09.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=33
author=@dhermes

Include a test HTML with JS client

At the end of each guide, there should be a basic html test client. They should also be included in the repository. For simplicity, I would have it as an actual HTML page.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/104392738264586850178/
author.name=[email protected]
id=0
published=2012-12-21T20:26:20.000Z

Code Hosting Issue Metadata:
published=2012-12-21T20:26:20.000Z
stars=2
updated=2013-02-23T01:44:11.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=27
author=@beriberikix
cc=[
  @beriberikix,
]

Not specifying _message_fields_schema falls back to EndpointsModel.

Not specifying _message_fields_schema falls back to EndpointsModel.

Bug introduced in: be3b963

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-02-21T22:21:21.000Z

Code Hosting Issue Metadata:
published=2013-02-21T22:21:21.000Z
stars=1
updated=2013-02-22T01:29:15.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=47
author=@dhermes
cc=[
  @danholevoet,
  @fredsa,
]

Update example docs to point to zip downloads and automate zip creation

See #29 for a sample script for zip creation

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-02-23T07:04:40.000Z

Code Hosting Issue Metadata:
published=2013-02-23T07:04:40.000Z
stars=1
updated=2013-02-23T07:04:40.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=51
author=@dhermes

Add support for NDB polymodel

Try to add support for polymodel
https://developers.google.com/appengine/docs/python/ndb/polymodelclass

Need to investigate/discuss before fully committing.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-01-10T01:53:13.000Z

Code Hosting Issue Metadata:
published=2013-01-10T01:53:13.000Z
stars=2
updated=2013-04-23T18:21:34.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=32
author=@dhermes

TextProperty should be a StringField, not BytesField

TextProperty should be a StringField, not BytesField

ndb.TextProperty: messages.BytesField, # No concept of compressed here

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-02-21T20:40:11.000Z

Code Hosting Issue Metadata:
published=2013-02-21T20:40:11.000Z
stars=2
updated=2013-04-05T17:36:57.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=46
author=@dhermes

Sort all_fields by field number in EndpointsModel.FromMessage

In FromMessage, it is assumed that proto_model.all_fields() is ordered by number, but this is not the case.

The change was apparent when

alias_kwargs = {}

was removed in favor of

alias_args = []

to allow applying alias properties in the order they appear in all_fields.

for field in message_class.all_fields():

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2012-12-07T17:09:50.000Z

Code Hosting Issue Metadata:
published=2012-12-07T17:09:50.000Z
stars=1
updated=2013-01-18T06:50:20.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=14
author=@dhermes

Support Cloud SQL in the same fashion the ndb is supported.

Support Cloud SQL in the same fashion the ndb is supported. (This somewhat perverts the name "datastore" in "endpoints-proto-datastore".)

This would be in the package

endpoints_proto_datastore.cloudsql

and would force an update to _GetEndpointsMethodDecorator.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-02-03T00:16:18.000Z

Code Hosting Issue Metadata:
published=2013-02-03T00:16:18.000Z
stars=1
updated=2013-04-03T02:05:18.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=43
author=@dhermes

Adding scopes to decorator doesn't get added to the scope selector

Screen Shot 2012-12-24 at 9 54 06 AM
I'm not sure if this is an issue with the endpoints lib or I just don't understand how scopes should work but when I add:

  @MyModel.method(user_required=True, path='dial', http_method='POST', name='mymodel.insert',
                  scopes=['https://www.googleapis.com/auth/userinfo.email'])

I expect that the email scope would show up in the scope selector. Its very annoying that I keep on having to copy/paste the scope each time I refresh the server.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/104392738264586850178/
author.name=[email protected]
id=0
published=2012-12-24T17:58:45.000Z

Code Hosting Issue Metadata:
published=2012-12-24T17:58:45.000Z
stars=1
updated=2012-12-24T18:27:28.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=29
author=@beriberikix
owner.htmlLink=

Explain that request_fields/response fields == self.request/self.response

I spent a good 20 minutes trying to figure out how to work with post bodies. Once I figured out the *_fields was it, it become easy. A clear explanation of how Endpoints handles requests & responses differently from say webapp would be useful.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/104392738264586850178/
author.name=[email protected]
id=0
published=2012-12-24T18:04:39.000Z

Code Hosting Issue Metadata:
published=2012-12-24T18:04:39.000Z
stars=2
updated=2012-12-24T18:04:39.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=30
author=@beriberikix
owner.htmlLink=

We should not swallow exception stack traces

Try the following code:

  @MyModel.query_method(path='mymodel', name='mymodel.list')                 
  def MyModelList(self, query):
    # pretend my code is broken
    raise Exception(42)

EXPECTED:

  • stack trace in the dev_appserver console which I can investigate
  • stack trace in the admin console logs which I can investigate

ACTUAL:

  • No stack trace
  • No line number reporting where in user code the exception occurred

dev_appserver:

  ERROR    2013-01-20 17:48:47,366 service.py:196] Encountered unexpected error from ProtoRPC method implementation: Exception (42)
  INFO     2013-01-20 17:48:47,377 dev_appserver.py:3103] "POST /_ah/api/rpc HTTP/1.1" 500 -

production:

  "POST /_ah/spi/DirectoryApi.ParentGuardianList HTTP/1.1" 500 ....
  Encountered unexpected error from ProtoRPC method implementation: Exception (42)

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/fredsa/
author.name=fredsa
id=0
published=2013-01-20T17:55:51.000Z

Code Hosting Issue Metadata:
published=2013-01-20T17:55:51.000Z
stars=5
updated=2013-03-27T23:05:45.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=37
author=@fredsa

Bad key values cause 500 on GAE and 503 through endpoints

Bad key values cause 500 on GAE and 503 through endpoints

2013-04-15 21:21:00.556 /_ah/spi/SchemaApi.SchemaInsert 500 20ms ... yadda yadda yadda ...

W 2013-04-15 21:21:00.555
suspended generator _get_tasklet(context.py:266) raised BadRequestError(missing key id/name)

W 2013-04-15 21:21:00.555
suspended generator get(context.py:667) raised BadRequestError(missing key id/name)

E 2013-04-15 21:21:00.555
Encountered unexpected error from ProtoRPC method implementation: BadRequestError (missing key id/name)

This was caused by a property that filled the id with a value of '' (the empty string).

e.g. entity = cls.get_by_id('')

This likely occurred in _CopyFromEntity. I'm going to re-run this request with the protorpc patch that will aid in logging:
https://code.google.com/p/google-protorpc/source/detail?r=c70a502651a8317db84460fe0ad47a318b579b0b
but isn't in the SDK yet.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-04-16T04:26:26.000Z

Code Hosting Issue Metadata:
published=2013-04-16T04:26:26.000Z
stars=1
updated=2013-04-16T04:27:18.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=58
author=@dhermes

ndb.IntegerProperty doesn't work in generated Android libraries

What steps will reproduce the problem?

  1. Create a model with an ndb.IntegerProperty() (or even just include 'id' in your _message_fields_schema, which is implicitly an IntegerProperty()) and use it to generate an endpoints-proto-datastore API method.
  2. Build your Android library.
  3. Try to use it.

What is the expected output? What do you see instead?
When calling the API method described above, I get:
Caused by: java.lang.IllegalArgumentException: number type formatted as a JSON number cannot use @JsonString annotation [key id, field private java.lang.Long com.google.api.services.myapp.mymodel.MyClass.id]

What version of the product are you using? On what operating system?
Python on Windows 7.

Please provide any additional information below.
@dhermes suggested the following workaround:

Instead of

attr1 = ndb.IntegerProperty()

use

from protorpc import messages
from endpoints_proto_datastore.ndb import EndpointsVariantIntegerProperty
attr1 = EndpointsVariantIntegerProperty(variant=messages.Variant.INT32)

However, this doesn't work for the automatically generated 'id' field.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/113119781435562268682/
author.name=rich.bragg
id=0
published=2013-02-28T00:59:41.000Z

Code Hosting Issue Metadata:
published=2013-02-28T00:59:41.000Z
stars=2
updated=2013-02-28T17:57:03.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=52
author=@ubragg
cc=[
  @kdeus,
  @saiyr,
]

rename request/response_ordering to fields

Example:

@MyModel.method(request_fields=('attr1',),
                response_fields=('created',),

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/118023969811374967961/
author.name=[email protected]
id=0
published=2012-12-03T21:00:24.000Z

Code Hosting Issue Metadata:
published=2012-12-03T21:00:24.000Z
stars=2
updated=2013-01-18T05:20:27.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=11
author=@proppy
cc=[
  @proppy,
]

Document EndpointsModel._DefaultFields for people that want to create their own library on top of EndpointsModel

Document EndpointsModel._DefaultFields for people that want to create their own library on top of EndpointsModel

By overriding this method, people could define their own helper EndpointsAliasProperties similar to:

  • EndpointsModel.id
  • EndpointsModel.entityKey
  • EndpointsModel.limit
  • EndpointsModel.order
  • EndpointsModel.pageToken

and keep them out of the default message schema in the same way that id, entityKey, etc. are left out.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2012-12-12T00:31:00.000Z

Code Hosting Issue Metadata:
published=2012-12-12T00:31:00.000Z
stars=1
updated=2012-12-12T00:31:06.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=23
author=@dhermes
cc=[
  @proppy,
]

Allow a method like endpoints_proto_datastore.method that takes different model types for request and response

Allow a method like endpoints_proto_datastore.method that takes different model types for request and response

For reference, endpoints_proto_datastore.method takes any EndpointsModel:

def method(modelclass, **kwargs):

and turns it into a method, but currently this is equivalent to what is offered in endpoints_proto_datastore.ndb since we haven't implemented any other datastore APIs.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-02-22T06:23:35.000Z

Code Hosting Issue Metadata:
published=2013-02-22T06:23:35.000Z
stars=1
updated=2013-02-22T06:23:35.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=49
author=@dhermes

from_datastore entities don't get repeated properties set

When an entity is retrieved to seed a request (i.e. entity.from_datastore == True), values for repeated properties don't get set.

See the following code snippets for examples:

Regular non-repeated property set from datastore:

s~my-app-id> from endpoints_proto_datastore.ndb import EndpointsModel
s~my-app-id> class A(EndpointsModel):
...   a = ndb.StringProperty()
...   b = ndb.StringProperty()
... 
s~my-app-id> A(a='a', b='b').put()
Key('A', 1001)
s~my-app-id> request_message = A.ProtoModel(fields=('id',))
s~my-app-id> request = request_message(id=1001)
s~my-app-id> request = A.FromMessage(request)
s~my-app-id> request
A(key=Key('A', 1001), a=u'a', b=u'b')
s~my-app-id> request.from_datastore
True

Regular repeated property not set from datastore:

s~my-app-id> from endpoints_proto_datastore.ndb import EndpointsModel
s~my-app-id> class A(EndpointsModel):
...   a = ndb.StringProperty()
...   b = ndb.StringProperty(repeated=True)
... 
s~my-app-id> A(a='a', b=['b']).put()
Key('A', 5001)
s~my-app-id> request_message = A.ProtoModel(fields=('id',))
s~my-app-id> request = request_message(id=5001)
s~my-app-id> request = A.FromMessage(request)
s~my-app-id> request
A(key=Key('A', 5001), a=u'a', b=[])
s~my-app-id> request.from_datastore
True

Non-repeated structured property set from datastore:

s~my-app-id> from endpoints_proto_datastore.ndb import EndpointsModel
s~my-app-id> class A(EndpointsModel):
...   a = ndb.StringProperty()
...   b = ndb.StringProperty()
... 
s~my-app-id> class C(EndpointsModel):
...   c = ndb.StringProperty()
...   a_prop = ndb.StructuredProperty(A)
... 
s~my-app-id> a = A(a='a', b='b')
s~my-app-id> a.put()
Key('A', 2001)
s~my-app-id> c = C(c='c', a_prop=a)
s~my-app-id> c.put()
Key('C', 3001)
s~my-app-id> request_message = C.ProtoModel(fields=('id',))
s~my-app-id> request = request_message(id=3001)
s~my-app-id> request = C.FromMessage(request)
s~my-app-id> request
C(key=Key('C', 3001), a_prop=A(key=Key('A', 2001), a=u'a', b=u'b'), c=u'c')
s~my-app-id> request.from_datastore
True

Repeated structured property not set from datastore:

s~my-app-id> from endpoints_proto_datastore.ndb import EndpointsModel
s~my-app-id> class A(EndpointsModel):
...   a = ndb.StringProperty()
...   b = ndb.StringProperty()
... 
s~my-app-id> class C(EndpointsModel):
...   c = ndb.StringProperty()
...   a_prop = ndb.StructuredProperty(A, repeated=True)
... 
s~my-app-id> a = A(a='a', b='b')
s~my-app-id> a.put()
Key('A', 2001)
s~my-app-id> c = C(c='c', a_prop=[a])
s~my-app-id> c.put()
Key('C', 4001)
s~my-app-id> request_message = C.ProtoModel(fields=('id',))
s~my-app-id> request = request_message(id=4001)
s~my-app-id> request = C.FromMessage(request)
s~my-app-id> request
C(key=Key('C', 4001), a_prop=[], c=u'c')
s~my-app-id> request.from_datastore
True

This is likely because the default value for a repeated property is [], which, while not Truth-y is also not None.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-04-16T03:38:31.000Z

Code Hosting Issue Metadata:
published=2013-04-16T03:38:31.000Z
stars=1
updated=2013-04-16T23:39:31.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=57
author=@dhermes
cc=[
  @danholevoet,
  @fredsa,
]

Indicate 1.7.4 dependency

Currently, Endpoints needs 1.7.4. It should be a clear dependency in the intro.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/104392738264586850178/
author.name=[email protected]
id=0
published=2012-12-21T19:34:57.000Z

Code Hosting Issue Metadata:
published=2012-12-21T19:34:57.000Z
stars=2
updated=2013-02-22T06:47:15.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=25
author=@beriberikix
cc=[
  @beriberikix,
]

Properties with default value won't get correct value from datastore

What steps will reproduce the problem?

  1. Create any property with (default=value)
  2. Insert a new entity with property=othervalue overwriting the default
  3. Do a GET on the entity

What is the expected output? What do you see instead?
entity.property should be othervalue, but it is returned as value.

Cause is most likely this part

which only sets properties without a value, but properties with a default already have a value assigned at this point and won't be overwritten.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/112336147904981294875/
author.name=scarygami
id=0
published=2013-04-21T01:33:32.000Z

Code Hosting Issue Metadata:
published=2013-04-21T01:33:32.000Z
stars=2
updated=2013-04-23T22:44:14.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=59
author=@Scarygami

we need to support string based keys, not just integer based ids

It's quite common for developers to use string based keys rather than integer based keys. There needs to be a way for an EndpointsModel to incude the string based key over the wire.

Right now, _message_fields_schema can include 'id' in the list of fields, as a way to have integer based keys included on the wire. I suggest allowing 'string_id' and 'int_id'. Alternatively, perhaps one could specify 'key', which would cause an ndb.KeyProperty to be passed on the wire. This KeyProperty would contain either an int key or a str key.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/fredsa/
author.name=fredsa
id=0
published=2013-01-26T20:13:19.000Z

Code Hosting Issue Metadata:
published=2013-01-26T20:13:19.000Z
stars=2
updated=2013-01-26T20:13:19.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=39
author=@fredsa
owner.htmlLink=

Support db in the same fashion the ndb is supported

Support db in the same fashion the ndb is supported.

This would be in the package

endpoints_proto_datastore.db

and would force an update to _GetEndpointsMethodDecorator.

NOTE: THIS POST WAS EDITED AFTER BEING MIGRATED.



Code Hosting Comment Metadata:
author.htmlLink=https://code.google.com/u/[email protected]/
author.name=[email protected]
id=0
published=2013-02-03T00:15:47.000Z

Code Hosting Issue Metadata:
published=2013-02-03T00:15:47.000Z
stars=1
updated=2013-02-03T00:16:31.000Z
originalIssue=https://code.google.com/p/endpoints-proto-datastore/issues/detail?id=42
author=@dhermes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.