<s> from google . appengine . ext import ndb <EOL> from endpoints_proto_datastore . ndb import EndpointsModel <EOL> from endpoints_proto_datastore . ndb import EndpointsAliasProperty <EOL> from protorpc import messages <EOL> class ProductGroup ( EndpointsModel ) : <EOL> _message_fields_schema = ( <EOL> '<STR_LIT:id>' , '<STR_LIT>' , '<STR_LIT:description>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:url>' , '<STR_LIT:image>' , '<STR_LIT>' ) <EOL> _api_key = None <EOL> tag = ndb . StringProperty ( ) <EOL> description = ndb . StringProperty ( ) <EOL> url = ndb . StringProperty ( ) <EOL> image = ndb . StringProperty ( ) <EOL> so_tags = ndb . StringProperty ( repeated = True ) <EOL> category = ndb . StringProperty ( ) <EOL> product = ndb . StringProperty ( ) <EOL> def ApiKeySet ( self , value ) : <EOL> self . _api_key = value <EOL> @ EndpointsAliasProperty ( setter = ApiKeySet , property_type = messages . StringField ) <EOL> def api_key ( self ) : <EOL> return self . _api_key <EOL> def IdSet ( self , value ) : <EOL> if not isinstance ( value , basestring ) : <EOL> raise TypeError ( '<STR_LIT>' ) <EOL> self . UpdateFromKey ( ndb . Key ( ProductGroup , value ) ) <EOL> @ EndpointsAliasProperty ( setter = IdSet , required = True ) <EOL> def id ( self ) : <EOL> if self . key is not None : <EOL> return self . key . string_id ( ) <EOL> @ classmethod <EOL> def all_tags ( cls ) : <EOL> return [ entity . tag for entity in cls . query ( ) ] </s>
