bossylobster

endpoints-proto-datastore: Issue 52 hack

Feb 28th, 2013
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. class MyModel(EndpointsModel):
  2.   _message_fields_schema = ('id', ...)
  3.  
  4.   # ...
  5.  
  6.   @EndpointsAliasProperty(setter=EndpointsModel.IdSet,
  7.                           property_type=messages.IntegerField,
  8.                           variant=messages.Variant.INT32)
  9.   def id(self):
  10.     return super(MyModel, self).id
  11.  
  12. # OR
  13. class MyModel(EndpointsModel):
  14.   _message_fields_schema = ('id', ...)
  15.  
  16.   # ...
  17. MyModel.id._variant = messages.Variant.INT32
Add Comment
Please, Sign In to add comment