app/soc/models/ranker_root.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Fri, 18 Sep 2009 20:06:28 +0200
changeset 2957 f6515daaf000
parent 2588 db306bbda381
permissions -rw-r--r--
Enable document system for GHOP As can be seen from the changes outside app/soc/modules, there is still some work to be done to make the modules fully restricted to configuration changes and code in app/soc/modules. Reviewed-by: Sverre Rabbelier
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1607
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     2
#
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     3
# Copyright 2009 the Melange authors.
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     4
#
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     8
# 
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    10
# 
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    15
# limitations under the License.
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    16
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    17
"""This module contains the RankerRoot model
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    18
"""
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    19
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    20
__authors__ = [
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    21
  '"Lennard de Rijk" <ljvderijk@gmail.com>',
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    22
]
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    23
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    24
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    25
from google.appengine.ext import db
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    26
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    27
import soc.models.linkable
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    28
1623
8b70d6bb3f8f Renamed rankerroot to ranker_root and made some changes due to comments.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 1607
diff changeset
    29
1607
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    30
class RankerRoot(soc.models.linkable.Linkable):
1653
d46f7f7030fe Fix too long lines in soc.models.ranker_root module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1623
diff changeset
    31
  """Links the Root of a RankList tree to an owner and also 
d46f7f7030fe Fix too long lines in soc.models.ranker_root module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1623
diff changeset
    32
     gives it an unique ID.
1607
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    33
  """
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    34
4ef383aa54c4 Added RankerRoot model.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff changeset
    35
  #: A required reference property to the root of the RankList tree
2588
db306bbda381 Indention fixes and adding "reference_class=" in ReferenceProperty params.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 1653
diff changeset
    36
  root = db.ReferenceProperty(required=True, collection_name='roots')