|
1 #!/usr/bin/python2.5 |
|
2 # |
|
3 # Copyright 2008 the Melange authors. |
|
4 # |
|
5 # Licensed under the Apache License, Version 2.0 (the "License"); |
|
6 # you may not use this file except in compliance with the License. |
|
7 # You may obtain a copy of the License at |
|
8 # |
|
9 # http://www.apache.org/licenses/LICENSE-2.0 |
|
10 # |
|
11 # Unless required by applicable law or agreed to in writing, software |
|
12 # distributed under the License is distributed on an "AS IS" BASIS, |
|
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14 # See the License for the specific language governing permissions and |
|
15 # limitations under the License. |
|
16 |
|
17 """This module contains the HomeSettings Model.""" |
|
18 |
|
19 __authors__ = [ |
|
20 '"Pawel Solyga" <pawel.solyga@gmail.com>', |
|
21 '"Todd Larsen" <tlarsen@google.com>', |
|
22 ] |
|
23 |
|
24 |
|
25 from google.appengine.ext import db |
|
26 |
|
27 import polymodel |
|
28 |
|
29 from django.utils.translation import ugettext_lazy |
|
30 |
|
31 import soc.models.document |
|
32 |
|
33 |
|
34 class HomeSettings(polymodel.PolyModel): |
|
35 """Model that stores settings for various Home pages. |
|
36 |
|
37 This Model is the basis for more specific "/home" view settings, such as |
|
38 SiteSettings, ProgramSettings, etc. |
|
39 """ |
|
40 |
|
41 #: Reference to Document containing the contents of the "/home" page |
|
42 home = db.ReferenceProperty( |
|
43 reference_class=soc.models.document.Document, |
|
44 collection_name='home') |
|
45 home.help_text = ugettext_lazy( |
|
46 'Document to be used as the "/home" page static contents.') |
|
47 |
|
48 #: Valid ATOM or RSS feed url or None if unused. Feed entries are shown |
|
49 #: on the site page using Google's JavaScript blog widget |
|
50 feed_url = db.LinkProperty(verbose_name=ugettext_lazy('Feed URL')) |
|
51 feed_url.help_text = ugettext_lazy( |
|
52 'The URL should be a valid ATOM or RSS feed. ' |
|
53 'Feed entries are shown on the home page.') |
|
54 |
|
55 |