app/soc/logic/models/follower.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Mon, 24 Aug 2009 04:31:23 +0530
changeset 2787 8408741aee63
parent 1873 bbd4fa245285
permissions -rw-r--r--
Reverting last 4 patches containing GHOP related views. As Lennard suggested all the model patches should come first followed by the logic and views patches, to make sure nothing committed breaks the existing code after thorough review.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1873
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     2
#
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     3
# Copyright 2009 the Melange authors.
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     4
#
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     8
#
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    10
#
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    15
# limitations under the License.
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    16
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    17
"""Follower (Model) query functions.
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    18
"""
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    19
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    20
__authors__ = [
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    21
    '"Lennard de Rijk" <ljvderijk@gmail.com>',
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    22
  ]
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    23
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    24
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    25
from soc.logic.models import base
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    26
from soc.logic.models import linkable as linkable_logic
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    27
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    28
import soc.models.follower
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    29
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    30
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    31
class Logic(base.Logic):
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    32
  """Logic methods for the Follower model.
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    33
  """
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    34
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    35
  def __init__(self, model=soc.models.follower.Follower,
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    36
               base_model=None, scope_logic=linkable_logic):
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    37
    """Defines the name, key_name and model for this entity.
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    38
    """
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    39
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    40
    super(Logic, self).__init__(model, base_model=base_model,
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    41
                                scope_logic=scope_logic)
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    42
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    43
bbd4fa245285 Added the Follower Logic Module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    44
logic = Logic()