|
1 #!/usr/bin/python2.5 |
|
2 # |
|
3 # Copyright 2008 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 """Views for Programs. |
|
18 """ |
|
19 |
|
20 __authors__ = [ |
|
21 '"Sverre Rabbelier" <sverre@rabbelier.nl>', |
|
22 ] |
|
23 |
|
24 |
|
25 from django import forms |
|
26 |
|
27 from soc.logic import dicts |
|
28 from soc.views.models import base |
|
29 |
|
30 import soc.logic.models.timeline |
|
31 |
|
32 |
|
33 class View(base.View): |
|
34 """View methods for the Timeline model. |
|
35 """ |
|
36 |
|
37 def __init__(self, params=None): |
|
38 """Defines the fields and methods required for the base View class |
|
39 to provide the user with list, public, create, edit and delete views. |
|
40 |
|
41 Params: |
|
42 params: a dict with params for this View |
|
43 """ |
|
44 |
|
45 new_params = {} |
|
46 new_params['logic'] = soc.logic.models.timeline.logic |
|
47 |
|
48 new_params['name'] = "Timeline" |
|
49 new_params['name_short'] = "Timeline" |
|
50 new_params['name_plural'] = "Timelines" |
|
51 new_params['url_name'] = "timeline" |
|
52 new_params['module_name'] = "timeline" |
|
53 |
|
54 params = dicts.merge(params, new_params) |
|
55 |
|
56 super(View, self).__init__(params=params) |
|
57 |
|
58 |
|
59 view = View() |
|
60 |
|
61 create = view.create |
|
62 delete = view.delete |
|
63 edit = view.edit |
|
64 list = view.list |
|
65 public = view.public |