app/soc/models/presence_with_tos.py
author Sverre Rabbelier <srabbelier@gmail.com>
Thu, 09 Apr 2009 22:04:47 +0000
changeset 2137 3d5692ae414c
parent 1307 091a21cf3627
permissions -rw-r--r--
If nothing is assigned, return no assignments Before the popularity was returned instead. Patch by: Sverre Rabbelier
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1051
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     2
#
1307
091a21cf3627 Update the copyright notice for 2009.
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1229
diff changeset
     3
# Copyright 2009 the Melange authors.
1051
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     4
#
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     8
#
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    10
#
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    15
# limitations under the License.
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    16
1053
3b9552cf748a Rename the confusing Tossed Model class to PresenceWithToS.
Todd Larsen <tlarsen@google.com>
parents: 1051
diff changeset
    17
"""This module contains the PresenceWithToS Model.
1051
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    18
"""
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    19
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    20
__authors__ = [
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    21
  '"Sverre Rabbelier" <sverre@rabbelier.nl>',
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    22
]
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    23
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    24
from google.appengine.ext import db
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    25
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    26
from django.utils.translation import ugettext
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    27
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    28
import soc.models.presence
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    29
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    30
1053
3b9552cf748a Rename the confusing Tossed Model class to PresenceWithToS.
Todd Larsen <tlarsen@google.com>
parents: 1051
diff changeset
    31
class PresenceWithToS(soc.models.presence.Presence):
1051
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    32
  """Model of a Presence that has a Terms of Service.
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    33
  """
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    34
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    35
  #: Reference to Document containing optional Terms of Service
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    36
  tos = db.ReferenceProperty(
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    37
    reference_class=soc.models.document.Document,
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    38
    verbose_name=ugettext('Terms of Service'),
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    39
    collection_name='tos')
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    40
  tos.help_text = ugettext(
c532dd9def48 Create a new Tossed layer in the MVC
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    41
      'Document containing optional Terms of Service for participating.')