author | Madhusudan C.S <madhusudancs@gmail.com> |
Sat, 22 Aug 2009 03:56:14 +0530 | |
changeset 2783 | 339696f3f5cf |
parent 1474 | 5eaf734fb178 |
child 2784 | 801eee4eda9a |
permissions | -rw-r--r-- |
611
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/python2.5 |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
2 |
# |
1308
35b75ffcbb37
Partially reverted "Update the copyright notice for 2009."
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1307
diff
changeset
|
3 |
# Copyright 2008 the Melange authors. |
611
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
4 |
# |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
6 |
# you may not use this file except in compliance with the License. |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
7 |
# You may obtain a copy of the License at |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
8 |
# |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
10 |
# |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
11 |
# Unless required by applicable law or agreed to in writing, software |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
14 |
# See the License for the specific language governing permissions and |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
15 |
# limitations under the License. |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
16 |
|
643 | 17 |
"""Program (Model) query functions. |
611
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
18 |
""" |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
19 |
|
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
20 |
__authors__ = [ |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
21 |
'"Sverre Rabbelier" <sverre@rabbelier.nl>', |
769
a0ee643fe832
Added an elementary workflow choosing method to program creation.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
671
diff
changeset
|
22 |
'"Lennard de Rijk" <ljvderijk@gmail.com>', |
611
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
23 |
] |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
24 |
|
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
25 |
|
1053
3b9552cf748a
Rename the confusing Tossed Model class to PresenceWithToS.
Todd Larsen <tlarsen@google.com>
parents:
1051
diff
changeset
|
26 |
from soc.logic.models import presence_with_tos |
1474
5eaf734fb178
Set proper scope_logic for program and timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
27 |
from soc.logic.models import sponsor as sponsor_logic |
620
e74e0b74625f
Put the redirects in the views/helper/redirects.py module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
611
diff
changeset
|
28 |
|
778
bc13cd968946
Added support for mutliple edit forms based on entity type
Sverre Rabbelier <srabbelier@gmail.com>
parents:
769
diff
changeset
|
29 |
import gsoc.logic.models.timeline |
643 | 30 |
import soc.models.program |
620
e74e0b74625f
Put the redirects in the views/helper/redirects.py module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
611
diff
changeset
|
31 |
|
2783
339696f3f5cf
Extended program configuration create/edit views specifically to support GHOP.
Madhusudan C.S <madhusudancs@gmail.com>
parents:
1474
diff
changeset
|
32 |
import soc.modules.ghop.logic.models.timeline |
339696f3f5cf
Extended program configuration create/edit views specifically to support GHOP.
Madhusudan C.S <madhusudancs@gmail.com>
parents:
1474
diff
changeset
|
33 |
|
620
e74e0b74625f
Put the redirects in the views/helper/redirects.py module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
611
diff
changeset
|
34 |
|
1053
3b9552cf748a
Rename the confusing Tossed Model class to PresenceWithToS.
Todd Larsen <tlarsen@google.com>
parents:
1051
diff
changeset
|
35 |
class Logic(presence_with_tos.Logic): |
784
23eaf3aa19b1
Fix missing dots at the end of sentences in docstring and fix wrong import sorting in soc.logic.helper.notifications module.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
778
diff
changeset
|
36 |
"""Logic methods for the Program model. |
611
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
37 |
""" |
2ec30182e5f1
Move parameter construction into a seperate module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
38 |
|
671
2c02178037ff
Apply DI on the scope logic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
667
diff
changeset
|
39 |
def __init__(self, model=soc.models.program.Program, |
1474
5eaf734fb178
Set proper scope_logic for program and timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1308
diff
changeset
|
40 |
base_model=None, scope_logic=sponsor_logic): |
643 | 41 |
"""Defines the name, key_name and model for this entity. |
42 |
""" |
|
655
9635cbaa2dcd
Cleanups to the logic module
Sverre Rabbelier <srabbelier@gmail.com>
parents:
643
diff
changeset
|
43 |
|
2783
339696f3f5cf
Extended program configuration create/edit views specifically to support GHOP.
Madhusudan C.S <madhusudancs@gmail.com>
parents:
1474
diff
changeset
|
44 |
self.timeline_logic = gsoc.logic.models.timeline.logic |
339696f3f5cf
Extended program configuration create/edit views specifically to support GHOP.
Madhusudan C.S <madhusudancs@gmail.com>
parents:
1474
diff
changeset
|
45 |
|
671
2c02178037ff
Apply DI on the scope logic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
667
diff
changeset
|
46 |
super(Logic, self).__init__(model=model, base_model=base_model, |
2c02178037ff
Apply DI on the scope logic
Sverre Rabbelier <srabbelier@gmail.com>
parents:
667
diff
changeset
|
47 |
scope_logic=scope_logic) |
620
e74e0b74625f
Put the redirects in the views/helper/redirects.py module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
611
diff
changeset
|
48 |
|
e74e0b74625f
Put the redirects in the views/helper/redirects.py module.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
611
diff
changeset
|
49 |
|
643 | 50 |
logic = Logic() |