@@ -0,0 +1,1511 @@
+#!/usr/bin/python2.5%0A#%0A# Copyright 2010 the Melange authors.%0A# Copyright 2009 Jake McGuire.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A#   http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A%0A%22%22%22Module containing a storage model for stats data.%0A%22%22%22%0A%0A__authors__ = %5B%0A  '%22Sverre Rabbelier%22 %3Csverre@rabbelier.nl%3E',%0A  %5D%0A%0A%0Afrom google.appengine.ext import db%0A%0A%0Aclass ProfileData(db.Model):%0A  %22%22%22Profile data for one request.%0A  %22%22%22%0A%0A  #: the profile data in gzipped pickled string form%0A  profile = db.BlobProperty(required=True)%0A%0A  #: the path of the request this profile data belongs to%0A  path = db.StringProperty(required=True)%0A%0A  #: the user that made the request this profile data belongs to, if any%0A  user = db.UserProperty()%0A%0A%0Adef from_key(key):%0A  %22%22%22Returns profile data for the specified key.%0A  %22%22%22%0A%0A  return ProfileData.get_by_key_name(key)%0A%0A%0Adef store(key, path, profile, user):%0A  %22%22%22Stores the profile data with the specified attributes.%0A  %22%22%22%0A%0A  import logging%0A  logging.info(dir(user))%0A%0A  ProfileData.get_or_insert(key, path=path, profile=profile, user=user)%0A

Add a storage class for ProfileData