author | Todd Larsen <tlarsen@google.com> |
Sat, 22 Nov 2008 09:08:29 +0000 | |
changeset 547 | be0de865ffc9 |
parent 535 | 9045b8888772 |
child 655 | 9635cbaa2dcd |
permissions | -rw-r--r-- |
19
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/python2.5 |
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
2 |
# |
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
3 |
# Copyright 2008 the Melange authors. |
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
4 |
# |
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
6 |
# you may not use this file except in compliance with the License. |
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
7 |
# You may obtain a copy of the License at |
404
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
244
diff
changeset
|
8 |
# |
19
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
404
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
244
diff
changeset
|
10 |
# |
19
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
11 |
# Unless required by applicable law or agreed to in writing, software |
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
14 |
# See the License for the specific language governing permissions and |
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
15 |
# limitations under the License. |
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
16 |
|
535
9045b8888772
Refactor classes in soc/logic/models to make more use of inheritance. Add
Todd Larsen <tlarsen@google.com>
parents:
530
diff
changeset
|
17 |
"""Role (Model) query functions. |
404
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
244
diff
changeset
|
18 |
""" |
19
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
19 |
|
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
20 |
__authors__ = [ |
429
e50e18936f06
Fixed typo in e-mail address
Sverre Rabbelier <srabbelier@gmail.com>
parents:
410
diff
changeset
|
21 |
'"Sverre Rabbelier" <sverre@rabbelier.nl>', |
404
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
244
diff
changeset
|
22 |
] |
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
244
diff
changeset
|
23 |
|
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
244
diff
changeset
|
24 |
|
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
244
diff
changeset
|
25 |
from soc.logic.models import base |
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
244
diff
changeset
|
26 |
|
481
94834a1e6c01
Attempt to rename User.id to User.account, in preparation for making User be
Todd Larsen <tlarsen@google.com>
parents:
444
diff
changeset
|
27 |
import soc.models.role |
19
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
28 |
|
207
8ecc2e4198cd
Take advantage of the Model inheritance provided by polymodel.PolyModel to
Todd Larsen <tlarsen@google.com>
parents:
181
diff
changeset
|
29 |
|
404
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
244
diff
changeset
|
30 |
class Logic(base.Logic): |
535
9045b8888772
Refactor classes in soc/logic/models to make more use of inheritance. Add
Todd Larsen <tlarsen@google.com>
parents:
530
diff
changeset
|
31 |
"""Logic methods for the Role model. |
404
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
244
diff
changeset
|
32 |
""" |
19
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
33 |
|
535
9045b8888772
Refactor classes in soc/logic/models to make more use of inheritance. Add
Todd Larsen <tlarsen@google.com>
parents:
530
diff
changeset
|
34 |
def __init__(self, model=soc.models.role.Role, base_model=None): |
404
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
244
diff
changeset
|
35 |
"""Defines the name, key_name and model for this entity. |
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
244
diff
changeset
|
36 |
""" |
535
9045b8888772
Refactor classes in soc/logic/models to make more use of inheritance. Add
Todd Larsen <tlarsen@google.com>
parents:
530
diff
changeset
|
37 |
base.Logic.__init__(self, model, base_model=base_model) |
410
2af7f84f4fc7
Moved all key_name related things to the logic modules
Sverre Rabbelier <srabbelier@gmail.com>
parents:
409
diff
changeset
|
38 |
|
19
f2a5ec8fb780
Initial definition of the Host Model.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
39 |
|
404
44223e50e1fc
Added a Host profile and generalized some views
Sverre Rabbelier <srabbelier@gmail.com>
parents:
244
diff
changeset
|
40 |
logic = Logic() |