3 # Copyright 2008 the Melange authors.
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 """This module contains the Site Model."""
20 '"Pawel Solyga" <pawel.solyga@gmail.com>',
21 '"Lennard de Rijk" <ljvderijk@gmail.com>',
25 from google
.appengine
.ext
import db
27 from django
.utils
.translation
import ugettext
29 import soc
.models
.presence_with_tos
32 class Site(soc
.models
.presence_with_tos
.PresenceWithToS
):
33 """Model of a Site, which stores per site configuration.
35 The Site Model stores configuration information unique to the Melange
36 web site as a whole (in addition to any configuration that is common to
37 any "presence" on the site, such as a Group or Program).
40 #: The official name of the site
41 site_name
= db
.StringProperty(default
="Melange",
42 verbose_name
=ugettext('Site Name'))
43 site_name
.help_text
= ugettext('The official name of the Site')
45 #: A notice that should be displayed site-wide
46 site_notice
= db
.StringProperty(verbose_name
=ugettext('Site Notice'))
47 site_notice
.help_text
= ugettext('A notice that will be displayed site-wide')
49 maintenance_start
= db
.DateTimeProperty(
50 verbose_name
=ugettext('Maintenance start date'))
52 maintenance_end
= db
.DateTimeProperty(
53 verbose_name
=ugettext('Maintenance end date'))
55 #: Valid Google Analytics tracking number, if entered every page
56 #: is going to have Google Analytics JS initialization code in
57 #: the footer with the given tracking number.
58 ga_tracking_num
= db
.StringProperty(
59 verbose_name
=ugettext('Google Analytics'))
60 ga_tracking_num
.help_text
= ugettext(
61 'Valid Google Analytics tracking number. If the number is '
62 'entered every page is going to have Google Analytics '
63 'initialization code in footer.')
65 #: Valid Google Maps API Key. Used to embed Google Maps.
66 gmaps_api_key
= db
.StringProperty(verbose_name
=ugettext('Google Maps'))
67 gmaps_api_key
.help_text
= ugettext(
68 'Valid Google Maps API Key. This key is used for '
69 'embedding Google Maps into the website.')
71 #: No Reply Email address used for sending notification emails to site users
72 noreply_email
= db
.EmailProperty(verbose_name
=ugettext('No reply email'))
73 noreply_email
.help_text
= ugettext(
74 'No reply email address is used for sending emails to site users. '
75 'Email address provided in this field needs to be added as Developer '
76 'in GAE admin console.')