author | Lennard de Rijk <ljvderijk@gmail.com> |
Thu, 02 Apr 2009 19:38:49 +0000 | |
changeset 2054 | 4df153b8424c |
child 2074 | 5c75312566d5 |
permissions | -rw-r--r-- |
2054
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/python2.5 |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
2 |
# |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
3 |
# Copyright 2009 the Melange authors. |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
4 |
# |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
6 |
# you may not use this file except in compliance with the License. |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
7 |
# You may obtain a copy of the License at |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
8 |
# |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
10 |
# |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
11 |
# Unless required by applicable law or agreed to in writing, software |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
14 |
# See the License for the specific language governing permissions and |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
15 |
# limitations under the License. |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
16 |
|
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
17 |
"""This module contains the ProposalDuplicates Model. |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
18 |
""" |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
19 |
|
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
20 |
__authors__ = [ |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
21 |
'"Lennard de Rijk" <ljvderijk@gmail.com>', |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
22 |
] |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
23 |
|
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
24 |
|
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
25 |
from google.appengine.ext import db |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
26 |
|
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
27 |
from django.utils.translation import ugettext |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
28 |
|
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
29 |
import soc.models.linkable |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
30 |
|
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
31 |
|
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
32 |
class ProposalDuplicates(soc.models.linkable.Linkable): |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
33 |
"""Model used to store a JSON representation of the duplicate assignments |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
34 |
found in a Project-Based Program. |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
35 |
""" |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
36 |
|
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
37 |
#: JSON representation of the duplicates for use in the view |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
38 |
json_representation = db.TextProperty(required=True, default='') |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
39 |
|
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
40 |
#: date when this calculation was last updated |
4df153b8424c
Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
41 |
calculated_on = db.DateTimeProperty(auto_now=True) |