app/soc/logic/models/grading_survey_group.py
author Lennard de Rijk <ljvderijk@gmail.com>
Sat, 24 Oct 2009 15:14:11 -0700
changeset 3036 c703f3802841
parent 2628 0440ac4e5f34
permissions -rw-r--r--
Use skipFields method in the expando base logic.
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 2008 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
"""GradingSurveyGroup (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
from soc.logic.models import program as program_logic
2628
0440ac4e5f34 Added getRecordLogic method to GradingSurveyGroup Logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2584
diff changeset
    27
from soc.logic.models.grading_record import logic as record_logic
2577
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
import soc.models.grading_survey_group
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    30
2578
ad5c242ac0e2 Added missing blank line to GradingSurveyGroup logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2577
diff changeset
    31
2577
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    32
class Logic(base.Logic):
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    33
  """Logic methods for the GradingSurveyGroup model.
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    34
  """
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    35
2584
10858e5d5712 Fixed GradingRecord and GradingSurveyRecord Logic to load the correct Model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2578
diff changeset
    36
  def __init__(self, model=soc.models.grading_survey_group.GradingSurveyGroup,
2628
0440ac4e5f34 Added getRecordLogic method to GradingSurveyGroup Logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2584
diff changeset
    37
               base_model=None, scope_logic=program_logic,
0440ac4e5f34 Added getRecordLogic method to GradingSurveyGroup Logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2584
diff changeset
    38
               record_logic=record_logic):
2577
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    39
    """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
    40
    """
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    41
2628
0440ac4e5f34 Added getRecordLogic method to GradingSurveyGroup Logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2584
diff changeset
    42
    self.record_logic = record_logic
0440ac4e5f34 Added getRecordLogic method to GradingSurveyGroup Logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2584
diff changeset
    43
2577
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    44
    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
    45
                                scope_logic=scope_logic)
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    46
2628
0440ac4e5f34 Added getRecordLogic method to GradingSurveyGroup Logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2584
diff changeset
    47
  def getRecordLogic(self):
0440ac4e5f34 Added getRecordLogic method to GradingSurveyGroup Logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2584
diff changeset
    48
    """Returns Record logic belonging to the GradingSurveyGroup
0440ac4e5f34 Added getRecordLogic method to GradingSurveyGroup Logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2584
diff changeset
    49
    """
0440ac4e5f34 Added getRecordLogic method to GradingSurveyGroup Logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2584
diff changeset
    50
    return self.record_logic
0440ac4e5f34 Added getRecordLogic method to GradingSurveyGroup Logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2584
diff changeset
    51
2577
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    52
8ff2f23922b9 Added logic for GradingRecord and GradingSurveyGroup.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    53
logic = Logic()