app/soc/logic/models/grading_record.py
author Lennard de Rijk <ljvderijk@gmail.com>
Fri, 10 Jul 2009 11:59:00 +0200
changeset 2584 10858e5d5712
parent 2577 8ff2f23922b9
child 2617 274efd5c769d
permissions -rw-r--r--
Fixed GradingRecord and GradingSurveyRecord Logic to load the correct Model.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2577
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     2
#
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     3
# Copyright 2009 the Melange authors.
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     4
#
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     8
#
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    10
#
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    15
# limitations under the License.
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    16
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    17
"""GradingRecord (Model) query functions.
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    18
"""
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    19
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    20
__authors__ = [
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    21
  '"Lennard de Rijk" <ljvderijk@gmail.com>',
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    22
  ]
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    23
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    24
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    25
from soc.logic.models import base
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    26
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    27
import soc.models.grading_record
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    28
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    29
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    30
class Logic(base.Logic):
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    31
  """Logic methods for the GradingRecord model.
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    32
  """
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    33
2584
10858e5d5712 Fixed GradingRecord and GradingSurveyRecord Logic to load the correct Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2577
diff changeset
    34
  def __init__(self, model=soc.models.grading_record.GradingRecord,
2577
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    35
               base_model=None, scope_logic=None):
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    36
    """Defines the name, key_name and model for this entity.
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    37
    """
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    38
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    39
    super(Logic, self).__init__(model=model, base_model=base_model,
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    40
                                scope_logic=scope_logic, id_based=True)
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    41
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    42
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    43
logic = Logic()