Remove Author model (use Person instead). Update models after removing Author. Add new Sponsor, Organization models.
authorPawel Solyga <Pawel.Solyga@gmail.com>
Sun, 21 Sep 2008 08:50:42 +0000
changeset 181 fdd29818a954
parent 180 a1c6123f9d06
child 182 72f193fb5633
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
app/soc/models/administrator.py
app/soc/models/answer.py
app/soc/models/author.py
app/soc/models/club.py
app/soc/models/contributor.py
app/soc/models/document.py
app/soc/models/documentation.py
app/soc/models/group.py
app/soc/models/host.py
app/soc/models/organization.py
app/soc/models/person.py
app/soc/models/proposal.py
app/soc/models/review.py
app/soc/models/reviewer.py
app/soc/models/school.py
app/soc/models/site_settings.py
app/soc/models/sponsor.py
app/soc/models/task.py
app/soc/models/user.py
app/soc/models/work.py
--- a/app/soc/models/administrator.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/administrator.py	Sun Sep 21 08:50:42 2008 +0000
@@ -24,23 +24,23 @@
 from google.appengine.ext import db
 
 from soc import models
-import soc.models.author
+from soc.models import base
+import soc.models.org
+import soc.models.person
 
 
-class Administrator(db.Model):
+class Administrator(base.ModelWithFieldAttributes):
   """Administrator details for a specific Program.
-
-  An Administrator entity participates in the following relationships
-  implemented as a db.ReferenceProperty elsewhere in another db.Model:
+  """
+  
+  #: A 1:1 relationship associating an Administrator with specific
+  #: Person details and capabilities. The back-reference in the
+  #: Person model is a Query named 'admin'.
+  person = db.ReferenceProperty(reference_class=soc.models.person.Person,
+          required=True, collection_name="admin")
 
-   host)  an optional 1:1 relationship associating generic Administrator
-     details and capabilities with a specific Host.  This relation is
-     implemented as the 'host' back-reference Query of the Host model
-     'admin' reference.
-  """
-
-  #: A 1:1 relationship associating an Administrator with generic
-  #: Author details and capabilities. The back-reference in the
-  #: Author model is a Query named 'admin'.
-  author = db.ReferenceProperty(reference_class=soc.models.author.Author,
-		  		required=True, collection_name="admin")
+  #: A many:1 relationship associating Administrators with specific
+  #: Organization details and capabilities. The back-reference in the
+  #: Organization model is a Query named 'admins'.
+  org = db.ReferenceProperty(reference_class=soc.models.org.Organization, 
+          required=True, collection_name="admins")
--- a/app/soc/models/answer.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/answer.py	Sun Sep 21 08:50:42 2008 +0000
@@ -24,11 +24,12 @@
 from google.appengine.ext import db
 
 from soc import models
+from soc.models import base
 import soc.models.question
 import soc.models.review
 
 
-class Answer(db.Model):
+class Answer(base.ModelWithFieldAttributes):
   """Model of a specific Answer to a Question in a specific Review."""
 
   #: A required many:1 relationship, where each of many Answers is
--- a/app/soc/models/author.py	Sun Sep 21 02:16:00 2008 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-#!/usr/bin/python2.5
-#
-# Copyright 2008 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.
-
-"""This module contains the Author Model."""
-
-__authors__ = [
-  '"Todd Larsen" <tlarsen@google.com>',
-  '"Sverre Rabbelier" <sverre@rabbelier.nl>',
-]
-
-from google.appengine.ext import db
-
-from soc import models
-import soc.models.person
-
-
-class Author(db.Model):
-  """Author details for a specific Program.
-
-  An Author entity participates in the following relationships implemented 
-  as a db.ReferenceProperty elsewhere in another db.Model:
-
-   works)  a many:many relationship with Works, stored in a separate
-     WorksAuthors model.  See the WorksAuthors model class for details.
-
-   contributor)  a 1:1 relationship associating a Contributor with generic
-     Author details and capabilities.  This relation is implemented as the
-     'contributor' back-reference Query of the Contributor model 'author'
-     reference.
-
-   reviewer)  a 1:1 relationship associating a Reviewer with generic
-     Author details and capabilities.  This relation is implemented as the
-     'reviewer' back-reference Query of the Reviewer model 'author' reference.
-
-   admin)  a 1:1 relationship associating an Administrator with generic
-     Author details and capabilities.  This relation is implemented as the
-     'admin' back-reference Query of the Administrator model 'author'
-     reference.
-  """
-
-  #: A required 1:1 relationship associating generic Person details
-  #: with the Author role entity.
-  person = db.ReferenceProperty(reference_class=models.person.Person, 
-		  		required=True, collection_name="author")
--- a/app/soc/models/club.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/club.py	Sun Sep 21 08:50:42 2008 +0000
@@ -23,8 +23,6 @@
 
 from google.appengine.ext import db
 
-from django.utils.translation import ugettext_lazy
-
 from soc.models import base
 import soc.models.group
 
--- a/app/soc/models/contributor.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/contributor.py	Sun Sep 21 08:50:42 2008 +0000
@@ -24,16 +24,17 @@
 from google.appengine.ext import db
 
 from soc import models
-import soc.models.author
+from soc.models import base
+import soc.models.person
 
 
-class Contributor(db.Model):
+class Contributor(base.ModelWithFieldAttributes):
   """Contributor details for a specific Program.
 
-  Some Contributor workflows have the Contributor (acting as an Author)
+  Some Contributor workflows have the Contributor (acting as an author)
   creating Proposals and desiring for one (or more?) of them to be
   converted into Tasks by Reviewers and Hosts.  Other workflows have the
-  Reviewers (acting as an Author) proposing Proposals, that Contributors
+  Reviewers (acting as an author) proposing Proposals, that Contributors
   claim to convert them into Tasks.
 
   A Contributor entity participates in the following relationships implemented 
@@ -47,6 +48,6 @@
   #: a 1:1 relationship associating a Contributor with generic Author
   #: details and capabilities. The back-reference in the Author
   #: model is a Query named 'contributor'.
-  author = db.ReferenceProperty(reference_class=models.author.Author, 
+  person = db.ReferenceProperty(reference_class=models.person.Person, 
                                 required=True, 
                                 collection_name="contributor")
--- a/app/soc/models/document.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/document.py	Sun Sep 21 08:50:42 2008 +0000
@@ -21,32 +21,47 @@
 ]
 
 from google.appengine.ext import db
+
 from django.utils.translation import ugettext_lazy
+
+from soc.models import base
 import soc.models.user
 
-class Document(db.Model):
+
+class Document(base.ModelWithFieldAttributes):
   """Model of a Document.
   
   Document is used for things like FAQs, front page text etc.
   """
 
+  #: Document title displayed on the top of the page
   title = db.StringProperty(required=True,
       verbose_name=ugettext_lazy('Title'))
-  title.help_text = ugettext_lazy('Document title displayed on the top of the page')
+  title.help_text = ugettext_lazy(
+      'Document title displayed on the top of the page')
 
+  #: Document link name used in URLs
   link_name = db.StringProperty(required=True,
       verbose_name=ugettext_lazy('Link name'))
   link_name.help_text = ugettext_lazy('Document link name used in URLs')
 
+  #: Document short name used for sidebar menu
   short_name = db.StringProperty(required=True,
       verbose_name=ugettext_lazy('Short name'))
-  short_name.help_text = ugettext_lazy('Document short name used for sidebar menu')
+  short_name.help_text = ugettext_lazy(
+      'Document short name used for sidebar menu')
   
+  #: Content of the document
   content = db.TextProperty(
       verbose_name=ugettext_lazy('Content'))
   
+  #: Date when the document was created.
   created = db.DateTimeProperty(auto_now_add=True)
+  
+  #: Date when the document was modified.
   modified = db.DateTimeProperty(auto_now=True)
+  
+  #: User who created this document.
   user = db.ReferenceProperty(reference_class=soc.models.user.User,
                               required=True, collection_name='documents')
 
--- a/app/soc/models/documentation.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/documentation.py	Sun Sep 21 08:50:42 2008 +0000
@@ -25,7 +25,7 @@
 
 from soc import models
 import soc.models.person
-
+import soc.models.work
 
 class Documentation(db.Model):
   """Model of Documentation, which is a Work authored by Administrators."""
@@ -48,13 +48,13 @@
   #:
   #:   work.reviews: Annotations to the Documentation made by other
   #:     Administrators.
-  work = db.ReferenceProperty(reference_class=soc.models.work.Work, required=True,
+  work = db.ReferenceProperty(reference_class=models.work.Work, required=True,
                               collection_name="proposal")
 
   #: a many:1 relationship of Documentation entities that pertain
   #: to a single Person.  The back-reference in the Person model is a
   #: Query named 'docs'.
-  person = db.ReferenceProperty(reference_class=soc.models.person.Person,
+  person = db.ReferenceProperty(reference_class=models.person.Person,
                                 collection_name="docs")
 
   #: An optional db.BlobProperty containing the documentation
--- a/app/soc/models/group.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/group.py	Sun Sep 21 08:50:42 2008 +0000
@@ -5,9 +5,9 @@
 # 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.
@@ -18,6 +18,7 @@
 
 __authors__ = [
   '"Todd Larsen" <tlarsen@google.com>',
+  '"Pawel Solyga" <pawel.solyga@gmail.com>',
 ]
 
 from google.appengine.ext import db
@@ -25,14 +26,14 @@
 from django.utils.translation import ugettext_lazy
 
 from soc.models import base
+from soc.models import countries
 import soc.models.user
 
-
 class Group(base.ModelWithFieldAttributes):
   """Common data fields for all groups.
 
-  A Group entity participates in the following relationships implemented as
-  a db.ReferenceProperty elsewhere in another db.Model:
+  A Group entity participates in the following relationships
+  implemented as a db.ReferenceProperty elsewhere in another db.Model:
 
    school), club), sponsor), org)
      a 1:1 relationship with each entity containing a more specific type of
@@ -43,39 +44,86 @@
      above relationship names correspond, respectively to these Models:
        School, Club, Sponsor, Organization
      The relationships listed here are mutually exclusive.  For example,
-     a Group cannot be both a School and a Club at the same time.
+     a Group cannot be both a School and a Club at the same time.  
   """
 
+  #: Required field storing name of the group.
+  name = db.StringProperty(required=True,
+      verbose_name=ugettext_lazy('Name'))
+  name.help_text = ugettext_lazy('Complete, formal name of the group.')  
+  
+  #: Required field storing linkname used in URLs to identify group.
+  #: Lower ASCII characters only.
+  link_name = db.StringProperty(required=True,
+      verbose_name=ugettext_lazy('Link name'))
+  link_name.help_text = ugettext_lazy(
+      'Field used in URLs to identify group. '
+      'Lower ASCII characters only.')
+  
+  #: Required field storing short name of the group.
+  #: It can be used for displaying group as sidebar menu item.
+  short_name = db.StringProperty(required=True,
+      verbose_name=ugettext_lazy('Short name'))
+  short_name.help_text = ugettext_lazy('Short name used for sidebar menu')
+
   #: Required many:1 relationship indicating the founding User of the
   #: Group (this relationship is needed to keep track of lifetime group
   #: creation limits, used to prevent spamming, etc.).
   founder = db.ReferenceProperty(reference_class=soc.models.user.User,
-                                 required=True, collection_name="groups")
-
-  #: Required organization name; can only be lower ASCII, not UTF-8
-  #: text, because it is used, for example, as part of the shipping
-  #: address.
-  name = db.StringProperty(required=True)
-
-  #: Optional field used as a display name, such in Group lists displayed
-  #: in the web application.  Should be the entire display name in the
-  #: format the Group would like it displayed. Display names can be any
-  #: valid UTF-8 text.
-  displayname = db.StringProperty()
-
-  #: Required email address used as the "public" contact mechanism for
+                                 required=True, collection_name="groups")  
+  #: Optional field storing a home page URL of the group.
+  home_page = db.LinkProperty(
+      verbose_name=ugettext_lazy('Home Page URL'))
+  
+  #: Optional email address used as the "public" contact mechanism for
   #: the Group (as opposed to the founder.id email address which is kept
   #: secret, revealed only to Developers).
-  email = db.EmailProperty(required=True)
+  email = db.EmailProperty(
+      verbose_name=ugettext_lazy('Email'))  
+  
+  #: Optional field storing description of the group.
+  description = db.TextProperty(
+      verbose_name=ugettext_lazy('Description'))
+      
+  #: Optional field containing a group street address.
+  #: Group street address can only be lower ASCII, not UTF-8 text, 
+  #: because, if supplied, it is used as a shipping address.
+  street = db.StringProperty(
+      verbose_name=ugettext_lazy('Street address'))
+  street.help_text = ugettext_lazy(
+      'street number and name, lower ASCII characters only')
 
-  #: Required home page URL.
-  homepage = db.LinkProperty(required=True)
-
-  # TODO(pawel.solyga): merge in the (required) mailing address stuff here...
+  #: Optional field containing group address city.
+  #: City can only be lower ASCII, not UTF-8 text, because, if
+  #: supplied, it is used as a shipping address.
+  city = db.StringProperty(
+      verbose_name=ugettext_lazy('City'))
+  city.help_text = ugettext_lazy('lower ASCII characters only')
 
-  # TODO(pawel.solyga): merge in the (optional) shipping address stuff here...
+  #: Optional field containing group address state or province.
+  #: Group state/province can only be lower ASCII, not UTF-8
+  #: text, because, if supplied, it is used as a shipping address.
+  state = db.StringProperty(
+      verbose_name=ugettext_lazy('State/Province'))
+  state.help_text = ugettext_lazy(
+      'optional if country/territory does not have states or provinces, '
+      'lower ASCII characters only')
+
+  #: Optional field containing address country or territory of the group.
+  country = db.StringProperty(
+      verbose_name=ugettext_lazy('Country/Territory'),
+      choices=countries.COUNTRIES_AND_TERRITORIES)
 
-  #: Required contact phone number that will be, amongst other uses,
+  #: Optional field containing address postal code of the group (ZIP code in
+  #: the United States). Postal code can only be lower ASCII, not UTF-8 
+  #: text, because, if supplied, it is used as a shipping address.
+  postalcode = db.StringProperty(
+      verbose_name=ugettext_lazy('ZIP/Postal Code'))
+  postalcode.help_text=ugettext_lazy('lower ASCII characters only')
+
+  #: Optional contact phone number that will be, amongst other uses,
   #: supplied to shippers along with the shipping address; kept private.
-  phone = db.PhoneNumberProperty(required=True)
-
+  phone = db.PhoneNumberProperty(
+      verbose_name=ugettext_lazy('Phone Number'))
+  phone.help_text = ugettext_lazy(
+      'include complete international calling number with country code')
\ No newline at end of file
--- a/app/soc/models/host.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/host.py	Sun Sep 21 08:50:42 2008 +0000
@@ -23,16 +23,24 @@
 
 from google.appengine.ext import db
 
+from soc.models import base
 from soc import models
-import soc.models.administrator
+import soc.models.person
+import soc.models.sponsor
 
 
-class Host(db.Model):
+class Host(base.ModelWithFieldAttributes):
   """Host details for a specific Program."""
 
-  #: A 1:1 relationship associating a Host with more generic
-  #: Administrator details and capabilities.  The back-reference in
-  #: the Administrator model is a Query named 'host'.
-  admin = db.ReferenceProperty(reference_class=models.administrator.Administrator, 
+  #: A 1:1 relationship associating a Host with specific
+  #: Person details and capabilities.  The back-reference in
+  #: the Person model is a Query named 'host'.
+  person = db.ReferenceProperty(reference_class=models.person.Person, 
                                required=True, collection_name="host")
 
+  #: A 1:1 relationship associating a Host with specific
+  #: Sponsor details and capabilities. The back-reference in
+  #: the Sponsor model is a Query named 'host'.  
+  sponsor = db.ReferenceProperty(reference_class=models.sponsor.Sponsor,
+                                 required=True, collection_name="host")
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/soc/models/organization.py	Sun Sep 21 08:50:42 2008 +0000
@@ -0,0 +1,47 @@
+#!/usr/bin/python2.5
+#
+# Copyright 2008 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.
+
+"""This module contains the Organization Model."""
+
+__authors__ = [
+  '"Pawel Solyga" <pawel.solyga@gmail.com>',
+]
+
+from google.appengine.ext import db
+
+from soc.models import base
+from soc import models
+import soc.models.group
+import soc.models.administrator
+
+class Organization(base.ModelWithFieldAttributes):
+  """Organization details.
+
+  A Organization entity participates in the following relationships implemented 
+  as a db.ReferenceProperty elsewhere in another db.Model:
+
+   admins)  a many:1 relationship associating Administrators with
+     a specific Organization. This relation is implemented as the
+     'admins' back-reference Query of the Organization model 'org' reference.
+
+  """
+
+  #: A 1:1 relationship associating a Organization with more generic
+  #: Group details and capabilities.  The back-reference in
+  #: the Group model is a Query named 'org'.
+  group = db.ReferenceProperty(reference_class=models.group.Group, 
+                               required=True, collection_name="org")
+                               
--- a/app/soc/models/person.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/person.py	Sun Sep 21 08:50:42 2008 +0000
@@ -25,12 +25,12 @@
 from django.utils.translation import ugettext_lazy
 
 from soc import models
+from soc.models import base
+from soc.models import countries
 import soc.models.user
 
-from soc.models import countries
 
-
-class Person(db.Model):
+class Person(base.ModelWithFieldAttributes):
   """Common data fields for all Roles.
 
   A Person can only participate in a single Program.  To avoid duplication of
@@ -47,14 +47,31 @@
   A Person entity participates in the following relationships implemented
   as a db.ReferenceProperty elsewhere in another db.Model:
 
-   author)  a 1:1 relationship of Person details for a specific Author.
-     This relation is implemented as the 'author' back-reference Query of
-     the Author model 'person' reference.
-
-   docs)  a 1:many relationship of documents (Documentation) associated
+   docs) a 1:many relationship of documents (Documentation) associated
      with the Person by Administrators.  This relation is implemented as
      the 'docs' back-reference Query of the Documentation model 'person'
      reference.
+
+   works) a many:many relationship with Works, stored in a separate
+     WorksPersons model.  See the WorksPersons model class for details.
+
+   contributor) a 1:1 relationship associating a Contributor with generic
+     Person details and capabilities.  This relation is implemented as the
+     'contributor' back-reference Query of the Contributor model 'person'
+     reference.
+
+   reviewer) a 1:1 relationship associating a Reviewer with generic
+     Person details and capabilities.  This relation is implemented as the
+     'reviewer' back-reference Query of the Reviewer model 'person' reference.
+
+   admin) a 1:1 relationship associating an Administrator with specific
+     Person details and capabilities.  This relation is implemented as the
+     'admin' back-reference Query of the Administrator model 'person'
+     reference.
+
+   host) a 1:1 relationship accociating a Host with specific Person
+     Person details and capabilities. This relation is implemented as the
+     'host' back-reference Query of the Host model 'person' reference.
   """
 
   #: A required many:1 relationship that ties (possibly multiple
--- a/app/soc/models/proposal.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/proposal.py	Sun Sep 21 08:50:42 2008 +0000
@@ -24,9 +24,10 @@
 from google.appengine.ext import db
 
 from soc import models
+from soc.models import base
 import soc.models.work
 
-class Proposal(db.Model):
+class Proposal(base.ModelWithFieldAttributes):
   """Model of a Proposal, which is a specific form of a Work.
 
   A Proposal entity participates in the following relationships implemented 
@@ -47,7 +48,7 @@
 	#: work.title:  the title of the Proposal.
 	#: work.abstract:  publicly displayed as a proposal abstract or summary.
 	#: work.reviews:  reviews of the Proposal by Reviewers.
-  work = db.ReferenceProperty(reference_class=soc.models.work.Work, required=True,
+  work = db.ReferenceProperty(reference_class=models.work.Work, required=True,
                               collection_name="proposal")
 
   #: Required db.TextProperty describing the proposal in detail.
--- a/app/soc/models/review.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/review.py	Sun Sep 21 08:50:42 2008 +0000
@@ -69,7 +69,7 @@
   #: back-reference in the Survey model is a Query named 'reviews'
   #: which represents all of the Reviews that contains Answers to the
   #: Questions in that particular Survey.
-  survey = db.ReferenceProperty(reference_class=models.survey.Survey,
+  survey = db.ReferenceProperty(reference_class=soc.models.survey.Survey,
                                 required=True, collection_name="reviews")
 
   #: A required many:1 relationship with a Work, where the Review
@@ -79,7 +79,7 @@
   #: back-reference in the Work model is a Query named 'reviews'
   #: which represents all of the annotations attached to that
   #: particular work.
-  reviewed = db.ReferenceProperty(reference_class=models.work.Work, 
+  reviewed = db.ReferenceProperty(reference_class=soc.models.work.Work, 
                                   required=True, collection_name="reviews")
                                   
   #: A required many:1 relationship with a Reviewer entity indicating
@@ -87,6 +87,6 @@
   #: instance. The back-reference in the Reviewer model is a Query
   #: named 'reviews' which represents all of the Reviews by that
   #: particular Reviewer.
-  reviewer = db.ReferenceProperty(reference_class=models.reviewer.Reviewer,
+  reviewer = db.ReferenceProperty(reference_class=soc.models.reviewer.Reviewer,
                                   required=True, collection_name="reviews")
 
--- a/app/soc/models/reviewer.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/reviewer.py	Sun Sep 21 08:50:42 2008 +0000
@@ -38,9 +38,9 @@
      back-reference Query of the Review model 'reviewer' reference.
   """
   
-  #: A 1:1 relationship associating a Contributor with generic Author
-  #: details and capabilities. The back-reference in the Author model
-  #: is a Query named 'contributor'.
-  author = db.ReferenceProperty(reference_class=models.author.Author,
+  #: A 1:1 relationship associating a Contributor with Person
+  #: details and capabilities. The back-reference in the Person model
+  #: is a Query named 'reviewer'.
+  person = db.ReferenceProperty(reference_class=models.person.Person,
                                 required=True, collection_name="reviewer")
 
--- a/app/soc/models/school.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/school.py	Sun Sep 21 08:50:42 2008 +0000
@@ -23,8 +23,6 @@
 
 from google.appengine.ext import db
 
-from django.utils.translation import ugettext_lazy
-
 from soc.models import base
 import soc.models.group
 
--- a/app/soc/models/site_settings.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/site_settings.py	Sun Sep 21 08:50:42 2008 +0000
@@ -21,9 +21,12 @@
 ]
 
 from google.appengine.ext import db
+
 from django.utils.translation import ugettext_lazy
 
-class SiteSettings(db.Model):
+from soc.models import base
+
+class SiteSettings(base.ModelWithFieldAttributes):
   """Model of a SiteSettings, which stores per site configuration."""
   
   #: Valid ATOM or RSS feed url or None if unused. Feed entries are shown 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/soc/models/sponsor.py	Sun Sep 21 08:50:42 2008 +0000
@@ -0,0 +1,38 @@
+#!/usr/bin/python2.5
+#
+# Copyright 2008 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.
+
+"""This module contains the Sponsor Model."""
+
+__authors__ = [
+  '"Pawel Solyga" <pawel.solyga@gmail.com>',
+]
+
+from google.appengine.ext import db
+
+from soc import models
+from soc.models import base
+import soc.models.group
+
+
+class Sponsor(base.ModelWithFieldAttributes):
+  """Sponsor details."""
+
+  #: A 1:1 relationship associating a Sponsor with more generic
+  #: Group details and capabilities.  The back-reference in
+  #: the Group model is a Query named 'sponsor'.
+  group = db.ReferenceProperty(reference_class=models.group.Group, 
+                               required=True, collection_name="sponsor")
+                               
\ No newline at end of file
--- a/app/soc/models/task.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/task.py	Sun Sep 21 08:50:42 2008 +0000
@@ -24,10 +24,11 @@
 from google.appengine.ext import db
 
 from soc import models
+from soc.models import base
 import soc.models.proposal
 
 
-class Task(db.Model):
+class Task(base.ModelWithFieldAttributes):
   """Model of a Task, which is a Proposal to be completed by Contributors.
 
   A Task brings along a Proposal that was used to initiate the Task.  A Task
@@ -48,5 +49,5 @@
   #: back-reference in the Proposal model is a Query named 'tasks'.  
   proposal = db.ReferenceProperty(reference_class=models.proposal.Proposal,
                                   required=True,
-				  collection_name="tasks")
+                                  collection_name="tasks")
 
--- a/app/soc/models/user.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/user.py	Sun Sep 21 08:50:42 2008 +0000
@@ -23,15 +23,12 @@
 ]
 
 
-import logging
-
 from google.appengine.api import users
 from google.appengine.ext import db
 
 from django.utils.translation import ugettext_lazy
 
 from soc.models import base
-from soc.views.helpers import forms_helpers
 
 
 class User(base.ModelWithFieldAttributes):
@@ -50,6 +47,10 @@
    persons)  a 1:many relationship of Person entities identified by the
      User.  This relation is implemented as the 'persons' back-reference
      Query of the Person model 'user' reference.
+     
+   documents)  a 1:many relationship of Document entities identified by the
+     User.  This relation is implemented as the 'user' back-reference
+     Query of the Document model 'user' reference.
 
   """
 
--- a/app/soc/models/work.py	Sun Sep 21 02:16:00 2008 +0000
+++ b/app/soc/models/work.py	Sun Sep 21 08:50:42 2008 +0000
@@ -22,12 +22,12 @@
 ]
 
 from google.appengine.ext import db
-
+from soc.models import base
 
-class Work(db.Model):
+class Work(base.ModelWithFieldAttributes):
   """Model of a Work created by one or more Authors.
 
-  Work is a "base entity" of other more specific "works" created by "authors".
+  Work is a "base entity" of other more specific "works" created by "persons".
 
   A Work entity participates in the following relationships implemented
   as a db.ReferenceProperty elsewhere in another db.Model:
@@ -43,8 +43,8 @@
      The relationships listed here are mutually exclusive.  For example,
      a Work cannot be both a Proposal and a Survey at the same time.
 
-   authors)  a many:many relationship with Authors, stored in a separate
-     WorksAuthors model.  See the WorksAuthors model class for details.
+   persons)  a many:many relationship with Persons, stored in a separate
+     WorksPersons model.  See the WorksPersons model class for details.
 
    reviews)  a 1:many relationship between a Work and the zero or more
      Reviews of that Work.  This relation is implemented as the 'reviews'