|
1 #!/usr/bin/python2.5 |
|
2 # |
|
3 # Copyright 2009 the Melange authors. |
|
4 # |
|
5 # Licensed under the Apache License, Version 2.0 (the "License"); |
|
6 # you may not use this file except in compliance with the License. |
|
7 # You may obtain a copy of the License at |
|
8 # |
|
9 # http://www.apache.org/licenses/LICENSE-2.0 |
|
10 # |
|
11 # Unless required by applicable law or agreed to in writing, software |
|
12 # distributed under the License is distributed on an "AS IS" BASIS, |
|
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14 # See the License for the specific language governing permissions and |
|
15 # limitations under the License. |
|
16 |
|
17 """GHOP specific views for Organizations. |
|
18 """ |
|
19 |
|
20 __authors__ = [ |
|
21 '"Madhusudan.C.S" <madhusudancs@gmail.com>' |
|
22 ] |
|
23 |
|
24 |
|
25 import datetime |
|
26 |
|
27 from django import forms |
|
28 |
|
29 from soc.logic import cleaning |
|
30 from soc.logic import dicts |
|
31 from soc.views.helper import decorators |
|
32 from soc.views.models import organization |
|
33 from soc.views.sitemap import sidebar |
|
34 |
|
35 import soc.cache.logic |
|
36 |
|
37 from soc.modules.ghop.views.models import program as ghop_program_view |
|
38 |
|
39 import soc.modules.ghop.logic.models.organization |
|
40 |
|
41 |
|
42 class View(organization.View): |
|
43 """View methods for the GHOP Program model. |
|
44 """ |
|
45 |
|
46 def __init__(self, params=None): |
|
47 """Defines the fields and methods required for the program View class |
|
48 to provide the user with list, public, create, edit and delete views. |
|
49 |
|
50 Params: |
|
51 params: a dict with params for this View |
|
52 """ |
|
53 |
|
54 new_params = {} |
|
55 new_params['logic'] = soc.modules.ghop.logic.models.organization.logic |
|
56 new_params['scope_view'] = ghop_program_view |
|
57 |
|
58 new_params['name'] = "GHOP Organization" |
|
59 new_params['module_name'] = "organization" |
|
60 new_params['sidebar_grouping'] = 'Organizations' |
|
61 |
|
62 new_params['module_package'] = 'soc.modules.ghop.views.models' |
|
63 new_params['url_name'] = 'ghop/org' |
|
64 |
|
65 new_params['extra_dynaexclude'] = ['slots', 'slots_calculated', |
|
66 'nr_applications', 'nr_mentors', |
|
67 'slots_desired', 'ideas', |
|
68 'task_quota_limit'] |
|
69 |
|
70 params = dicts.merge(params, new_params, sub_merge=True) |
|
71 |
|
72 super(View, self).__init__(params=params) |
|
73 |
|
74 |
|
75 view = View() |
|
76 |
|
77 admin = decorators.view(view.admin) |
|
78 create = decorators.view(view.create) |
|
79 delete = decorators.view(view.delete) |
|
80 edit = decorators.view(view.edit) |
|
81 list = decorators.view(view.list) |
|
82 public = decorators.view(view.public) |
|
83 export = decorators.view(view.export) |
|
84 home = decorators.view(view.home) |