author | Lennard de Rijk <ljvderijk@gmail.com> |
Tue, 14 Jul 2009 16:46:42 +0200 | |
changeset 2643 | 222be0eb4aab |
parent 2209 | 989c7c945d5f |
permissions | -rw-r--r-- |
2209
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/python2.5 |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
2 |
# |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
3 |
# Copyright 2009 the Melange authors. |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
4 |
# |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
6 |
# you may not use this file except in compliance with the License. |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
7 |
# You may obtain a copy of the License at |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
8 |
# |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
10 |
# |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
11 |
# Unless required by applicable law or agreed to in writing, software |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
14 |
# See the License for the specific language governing permissions and |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
15 |
# limitations under the License. |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
16 |
|
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
17 |
"""Job (Model) query functions. |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
18 |
""" |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
19 |
|
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
20 |
__authors__ = [ |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
21 |
'"Sverre Rabbelier" <sverre@rabbelier.nl>', |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
22 |
] |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
23 |
|
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
24 |
|
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
25 |
from soc.logic.models import base |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
26 |
|
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
27 |
import soc.models.job |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
28 |
|
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
29 |
|
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
30 |
class Logic(base.Logic): |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
31 |
"""Logic methods for the Job model. |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
32 |
""" |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
33 |
|
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
34 |
def __init__(self, model=soc.models.job.Job, |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
35 |
base_model=None, scope_logic=None): |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
36 |
"""Defines the name, key_name and model for this entity. |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
37 |
""" |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
38 |
|
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
39 |
super(Logic, self).__init__(model=model, base_model=base_model, |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
40 |
scope_logic=scope_logic, id_based=True) |
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
41 |
|
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
42 |
|
989c7c945d5f
Add jobs (model, logic, and view)
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
43 |
logic = Logic() |