app/soc/models/group.py
author Pawel Solyga <Pawel.Solyga@gmail.com>
Sun, 21 Sep 2008 08:50:42 +0000
changeset 181 fdd29818a954
parent 174 f065ee52d759
child 208 e076aee6e90f
permissions -rw-r--r--
Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models. Patch by: Pawel Solyga Reviewed by: Todd Larsen Review issue: 801 Review URL: http://codereviews.googleopensourceprograms.com/801
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
174
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     2
#
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     3
# Copyright 2008 the Melange authors.
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     4
#
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
     8
# 
174
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    10
# 
174
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    15
# limitations under the License.
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    16
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    17
"""This module contains the Group Model."""
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    18
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    19
__authors__ = [
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    20
  '"Todd Larsen" <tlarsen@google.com>',
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    21
  '"Pawel Solyga" <pawel.solyga@gmail.com>',
174
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    22
]
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    23
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    24
from google.appengine.ext import db
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    25
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    26
from django.utils.translation import ugettext_lazy
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    27
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    28
from soc.models import base
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    29
from soc.models import countries
174
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    30
import soc.models.user
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    31
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    32
class Group(base.ModelWithFieldAttributes):
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    33
  """Common data fields for all groups.
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    34
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    35
  A Group entity participates in the following relationships
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    36
  implemented as a db.ReferenceProperty elsewhere in another db.Model:
174
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    37
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    38
   school), club), sponsor), org)
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    39
     a 1:1 relationship with each entity containing a more specific type of
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    40
     Group.  These relationships are represented explicitly in the other
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    41
     "group" models by a db.ReferenceProperty named 'group'.  The
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    42
     collection_name argument to db.ReferenceProperty should be set to the
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    43
     singular of the entity model name of the other "group" class.  The
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    44
     above relationship names correspond, respectively to these Models:
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    45
       School, Club, Sponsor, Organization
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    46
     The relationships listed here are mutually exclusive.  For example,
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    47
     a Group cannot be both a School and a Club at the same time.  
174
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    48
  """
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    49
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    50
  #: Required field storing name of the group.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    51
  name = db.StringProperty(required=True,
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    52
      verbose_name=ugettext_lazy('Name'))
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    53
  name.help_text = ugettext_lazy('Complete, formal name of the group.')  
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    54
  
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    55
  #: Required field storing linkname used in URLs to identify group.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    56
  #: Lower ASCII characters only.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    57
  link_name = db.StringProperty(required=True,
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    58
      verbose_name=ugettext_lazy('Link name'))
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    59
  link_name.help_text = ugettext_lazy(
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    60
      'Field used in URLs to identify group. '
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    61
      'Lower ASCII characters only.')
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    62
  
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    63
  #: Required field storing short name of the group.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    64
  #: It can be used for displaying group as sidebar menu item.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    65
  short_name = db.StringProperty(required=True,
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    66
      verbose_name=ugettext_lazy('Short name'))
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    67
  short_name.help_text = ugettext_lazy('Short name used for sidebar menu')
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    68
174
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    69
  #: Required many:1 relationship indicating the founding User of the
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    70
  #: Group (this relationship is needed to keep track of lifetime group
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    71
  #: creation limits, used to prevent spamming, etc.).
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    72
  founder = db.ReferenceProperty(reference_class=soc.models.user.User,
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    73
                                 required=True, collection_name="groups")  
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    74
  #: Optional field storing a home page URL of the group.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    75
  home_page = db.LinkProperty(
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    76
      verbose_name=ugettext_lazy('Home Page URL'))
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    77
  
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    78
  #: Optional email address used as the "public" contact mechanism for
174
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    79
  #: the Group (as opposed to the founder.id email address which is kept
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    80
  #: secret, revealed only to Developers).
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    81
  email = db.EmailProperty(
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    82
      verbose_name=ugettext_lazy('Email'))  
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    83
  
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    84
  #: Optional field storing description of the group.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    85
  description = db.TextProperty(
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    86
      verbose_name=ugettext_lazy('Description'))
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    87
      
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    88
  #: Optional field containing a group street address.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    89
  #: Group street address can only be lower ASCII, not UTF-8 text, 
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    90
  #: because, if supplied, it is used as a shipping address.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    91
  street = db.StringProperty(
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    92
      verbose_name=ugettext_lazy('Street address'))
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    93
  street.help_text = ugettext_lazy(
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    94
      'street number and name, lower ASCII characters only')
174
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
    95
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    96
  #: Optional field containing group address city.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    97
  #: City can only be lower ASCII, not UTF-8 text, because, if
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    98
  #: supplied, it is used as a shipping address.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
    99
  city = db.StringProperty(
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   100
      verbose_name=ugettext_lazy('City'))
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   101
  city.help_text = ugettext_lazy('lower ASCII characters only')
174
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
   102
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   103
  #: Optional field containing group address state or province.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   104
  #: Group state/province can only be lower ASCII, not UTF-8
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   105
  #: text, because, if supplied, it is used as a shipping address.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   106
  state = db.StringProperty(
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   107
      verbose_name=ugettext_lazy('State/Province'))
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   108
  state.help_text = ugettext_lazy(
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   109
      'optional if country/territory does not have states or provinces, '
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   110
      'lower ASCII characters only')
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   111
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   112
  #: Optional field containing address country or territory of the group.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   113
  country = db.StringProperty(
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   114
      verbose_name=ugettext_lazy('Country/Territory'),
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   115
      choices=countries.COUNTRIES_AND_TERRITORIES)
174
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
   116
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   117
  #: Optional field containing address postal code of the group (ZIP code in
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   118
  #: the United States). Postal code can only be lower ASCII, not UTF-8 
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   119
  #: text, because, if supplied, it is used as a shipping address.
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   120
  postalcode = db.StringProperty(
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   121
      verbose_name=ugettext_lazy('ZIP/Postal Code'))
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   122
  postalcode.help_text=ugettext_lazy('lower ASCII characters only')
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   123
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   124
  #: Optional contact phone number that will be, amongst other uses,
174
f065ee52d759 A rough draft of the Group Model, to be merged with Pawel's current effort in
Todd Larsen <tlarsen@google.com>
parents:
diff changeset
   125
  #: supplied to shippers along with the shipping address; kept private.
181
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   126
  phone = db.PhoneNumberProperty(
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   127
      verbose_name=ugettext_lazy('Phone Number'))
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   128
  phone.help_text = ugettext_lazy(
fdd29818a954 Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 174
diff changeset
   129
      'include complete international calling number with country code')