|
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 Site Model.""" |
|
18 |
|
19 __authors__ = [ |
|
20 '"Pawel Solyga" <pawel.solyga@gmail.com>', |
|
21 '"Lennard de Rijk" <ljvderijk@gmail.com>', |
|
22 ] |
|
23 |
|
24 |
|
25 from google.appengine.ext import db |
|
26 |
|
27 from django.utils.translation import ugettext_lazy |
|
28 |
|
29 import soc.models.presence |
|
30 |
|
31 |
|
32 class Site(soc.models.presence.Presence): |
|
33 """Model of a Site, which stores per site configuration. |
|
34 |
|
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). |
|
38 """ |
|
39 |
|
40 #: Valid Google Analytics tracking number, if entered every page |
|
41 #: is going to have Google Analytics JS initialization code in |
|
42 #: the footer with the given tracking number. |
|
43 ga_tracking_num = db.StringProperty( |
|
44 verbose_name=ugettext_lazy('Google Analytics')) |
|
45 ga_tracking_num.help_text = ugettext_lazy( |
|
46 'Valid Google Analytics tracking number. If the number is ' |
|
47 'entered every page is going to have Google Analytics ' |
|
48 'initialization code in footer.') |
|
49 |
|
50 #: Valid Google Maps API Key. Used to embed Google Maps. |
|
51 gmaps_api_key = db.StringProperty(verbose_name=ugettext_lazy('Google Maps')) |
|
52 gmaps_api_key.help_text = ugettext_lazy( |
|
53 'Valid Google Maps API Key. This key is used for ' |
|
54 'embedding Google Maps into the website.') |