app/soc/logic/models/proposal_duplicates.py
author Sverre Rabbelier <srabbelier@gmail.com>
Wed, 02 Sep 2009 10:24:10 +0200
changeset 2854 003a84e774e2
parent 2054 4df153b8424c
permissions -rw-r--r--
Add support for prefetching fields This makes it possible to specify the fields that should be prefetched as part of a getForFields query. Doing a prefetch on a ReferenceProperty when it is known that the property will be referenced in (almost all) entities is far more efficient than doing the invididual fetches sequentially.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
"""ProposalDuplicates (Model) query functions.
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 soc.logic.models import base
4df153b8424c Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    26
from soc.logic.models import program as program_logic
4df153b8424c Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    27
4df153b8424c Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    28
import soc.models.proposal_duplicates
4df153b8424c Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    29
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
class Logic(base.Logic):
4df153b8424c Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    32
  """Logic methods for the Role model.
4df153b8424c Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    33
  """
4df153b8424c Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    34
4df153b8424c Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    35
  def __init__(self, model=soc.models.proposal_duplicates.ProposalDuplicates,
4df153b8424c Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    36
               base_model=None, scope_logic=program_logic):
4df153b8424c Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    37
    """Defines the name, key_name and model for this entity.
4df153b8424c Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    38
    """
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
    super(Logic, self).__init__(model, base_model=base_model,
4df153b8424c Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    41
                                scope_logic=scope_logic)
4df153b8424c Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    42
4df153b8424c Added ProposalDuplicates model and logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    43
logic = Logic()