# HG changeset patch # User Lennard de Rijk # Date 1250109149 25200 # Node ID 80d625f7817653f6c78f54ef795da37aabf2f66e # Parent 02b464717ef5d662971be5407cf7e1ba89f51d6b Added base Model for Expando models. Due to comments on r031e5828f3. diff -r 02b464717ef5 -r 80d625f78176 app/soc/models/expando_base.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/models/expando_base.py Wed Aug 12 13:32:29 2009 -0700 @@ -0,0 +1,34 @@ +#!/usr/bin/python2.5 +# +# Copyright 2009 the Melange authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Module that cointains base class for Melange Expando models. +""" + +__authors__ = [ + '"Lennard de Rijk" ', +] + + +from google.appengine.ext import db + + +class ExpandoBase(db.Expando): + """Expando Base model. + + This might later on contain general functionalities like the + ModelWithFieldAttributes model. + """ + pass \ No newline at end of file diff -r 02b464717ef5 -r 80d625f78176 app/soc/models/survey.py --- a/app/soc/models/survey.py Wed Aug 12 11:31:05 2009 -0700 +++ b/app/soc/models/survey.py Wed Aug 12 13:32:29 2009 -0700 @@ -31,13 +31,15 @@ from django.utils.translation import ugettext +from soc.models.expando_base import ExpandoBase + import soc.models.work COMMENT_PREFIX = 'comment_for_' -class SurveyContent(db.Expando): +class SurveyContent(ExpandoBase): """Fields (questions) and schema representation of a Survey. Each survey content entity consists of properties where names and default diff -r 02b464717ef5 -r 80d625f78176 app/soc/models/survey_record.py --- a/app/soc/models/survey_record.py Wed Aug 12 11:31:05 2009 -0700 +++ b/app/soc/models/survey_record.py Wed Aug 12 13:32:29 2009 -0700 @@ -28,11 +28,12 @@ from django.utils.translation import ugettext +from soc.models.expando_base import ExpandoBase from soc.models.survey import Survey import soc.models.user -class BaseSurveyRecord(db.Expando): +class BaseSurveyRecord(ExpandoBase): """Record produced each time Survey is taken. Like SurveyContent, this model includes dynamic properties