author | Pawel Solyga <Pawel.Solyga@gmail.com> |
Sat, 24 Jan 2009 12:51:47 +0000 | |
changeset 958 | b4309e3cb899 |
parent 949 | 07fdadbd6dc7 |
child 1108 | 64acc3c02ad1 |
permissions | -rw-r--r-- |
768
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/python2.5 |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
2 |
# |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
3 |
# Copyright 2008 the Melange authors. |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
4 |
# |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
6 |
# you may not use this file except in compliance with the License. |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
7 |
# You may obtain a copy of the License at |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
8 |
# |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
10 |
# |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
11 |
# Unless required by applicable law or agreed to in writing, software |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
14 |
# See the License for the specific language governing permissions and |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
15 |
# limitations under the License. |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
16 |
|
847
b1077116fe59
Add calendar widget support for timeline fields. Fix docstring typo in soc.views.models.timeline module. Add timeline edit template which loads necessary javascript files for datetimepicker widget.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
799
diff
changeset
|
17 |
"""Views for Timeline. |
768
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
18 |
""" |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
19 |
|
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
20 |
__authors__ = [ |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
21 |
'"Sverre Rabbelier" <sverre@rabbelier.nl>', |
847
b1077116fe59
Add calendar widget support for timeline fields. Fix docstring typo in soc.views.models.timeline module. Add timeline edit template which loads necessary javascript files for datetimepicker widget.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
799
diff
changeset
|
22 |
'"Pawel Solyga" <pawel.solyga@gmail.com>', |
768
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
23 |
] |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
24 |
|
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
25 |
|
847
b1077116fe59
Add calendar widget support for timeline fields. Fix docstring typo in soc.views.models.timeline module. Add timeline edit template which loads necessary javascript files for datetimepicker widget.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
799
diff
changeset
|
26 |
from google.appengine.ext import db |
b1077116fe59
Add calendar widget support for timeline fields. Fix docstring typo in soc.views.models.timeline module. Add timeline edit template which loads necessary javascript files for datetimepicker widget.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
799
diff
changeset
|
27 |
|
768
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
28 |
from django import forms |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
29 |
|
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
30 |
from soc.logic import dicts |
778
bc13cd968946
Added support for mutliple edit forms based on entity type
Sverre Rabbelier <srabbelier@gmail.com>
parents:
776
diff
changeset
|
31 |
from soc.logic.models import program as program_logic |
949
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
32 |
from soc.views.helper import dynaform |
778
bc13cd968946
Added support for mutliple edit forms based on entity type
Sverre Rabbelier <srabbelier@gmail.com>
parents:
776
diff
changeset
|
33 |
from soc.views.helper import params as params_helper |
768
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
34 |
from soc.views.models import base |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
35 |
|
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
36 |
import soc.logic.models.timeline |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
37 |
|
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
38 |
|
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
39 |
class View(base.View): |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
40 |
"""View methods for the Timeline model. |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
41 |
""" |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
42 |
|
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
43 |
def __init__(self, params=None): |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
44 |
"""Defines the fields and methods required for the base View class |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
45 |
to provide the user with list, public, create, edit and delete views. |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
46 |
|
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
47 |
Params: |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
48 |
params: a dict with params for this View |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
49 |
""" |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
50 |
|
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
51 |
new_params = {} |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
52 |
new_params['logic'] = soc.logic.models.timeline.logic |
847
b1077116fe59
Add calendar widget support for timeline fields. Fix docstring typo in soc.views.models.timeline module. Add timeline edit template which loads necessary javascript files for datetimepicker widget.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
799
diff
changeset
|
53 |
new_params['edit_template'] = 'soc/timeline/edit.html' |
768
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
54 |
new_params['name'] = "Timeline" |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
55 |
|
776
f86a76f52bf4
Started on edit timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents:
768
diff
changeset
|
56 |
patterns = [(r'^%(url_name)s/(?P<access_type>edit)/%(key_fields)s$', |
847
b1077116fe59
Add calendar widget support for timeline fields. Fix docstring typo in soc.views.models.timeline module. Add timeline edit template which loads necessary javascript files for datetimepicker widget.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
799
diff
changeset
|
57 |
'soc.views.models.%(module_name)s.edit', |
b1077116fe59
Add calendar widget support for timeline fields. Fix docstring typo in soc.views.models.timeline module. Add timeline edit template which loads necessary javascript files for datetimepicker widget.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
799
diff
changeset
|
58 |
"Edit %(name_short)s")] |
776
f86a76f52bf4
Started on edit timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents:
768
diff
changeset
|
59 |
|
f86a76f52bf4
Started on edit timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents:
768
diff
changeset
|
60 |
new_params['django_patterns_defaults'] = patterns |
f86a76f52bf4
Started on edit timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents:
768
diff
changeset
|
61 |
|
847
b1077116fe59
Add calendar widget support for timeline fields. Fix docstring typo in soc.views.models.timeline module. Add timeline edit template which loads necessary javascript files for datetimepicker widget.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
799
diff
changeset
|
62 |
new_params['edit_dynafields'] = [] |
b1077116fe59
Add calendar widget support for timeline fields. Fix docstring typo in soc.views.models.timeline module. Add timeline edit template which loads necessary javascript files for datetimepicker widget.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
799
diff
changeset
|
63 |
|
768
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
64 |
params = dicts.merge(params, new_params) |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
65 |
|
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
66 |
super(View, self).__init__(params=params) |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
67 |
|
949
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
68 |
for name, logic_value in program_logic.logic.TIMELINE_LOGIC.iteritems(): |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
69 |
fields = {} |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
70 |
|
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
71 |
# add class 'datetime-pick' for each DateTimeField |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
72 |
# this is used with datetimepicker js widget |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
73 |
for prop_key, prop_value in logic_value.getModel().properties().iteritems(): |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
74 |
if isinstance(prop_value, db.DateTimeProperty): |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
75 |
fields[prop_key] = forms.DateTimeField(required=False, |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
76 |
widget=forms.TextInput(attrs={'class':'datetime-pick'})) |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
77 |
|
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
78 |
create_form = params_helper.getCreateForm(self._params, logic_value.getModel()) |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
79 |
edit_form = dynaform.extendDynaForm( |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
80 |
dynaform = create_form, |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
81 |
dynainclude = self._params['edit_dynainclude'], |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
82 |
dynaexclude = self._params['edit_dynaexclude'], |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
83 |
dynafields = fields, |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
84 |
) |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
85 |
|
778
bc13cd968946
Added support for mutliple edit forms based on entity type
Sverre Rabbelier <srabbelier@gmail.com>
parents:
776
diff
changeset
|
86 |
self._params['edit_form_%s' % name] = edit_form |
bc13cd968946
Added support for mutliple edit forms based on entity type
Sverre Rabbelier <srabbelier@gmail.com>
parents:
776
diff
changeset
|
87 |
|
bc13cd968946
Added support for mutliple edit forms based on entity type
Sverre Rabbelier <srabbelier@gmail.com>
parents:
776
diff
changeset
|
88 |
def edit(self, request, access_type, |
bc13cd968946
Added support for mutliple edit forms based on entity type
Sverre Rabbelier <srabbelier@gmail.com>
parents:
776
diff
changeset
|
89 |
page_name=None, params=None, seed=None, **kwargs): |
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
|
90 |
"""See base.View.edit. |
778
bc13cd968946
Added support for mutliple edit forms based on entity type
Sverre Rabbelier <srabbelier@gmail.com>
parents:
776
diff
changeset
|
91 |
""" |
bc13cd968946
Added support for mutliple edit forms based on entity type
Sverre Rabbelier <srabbelier@gmail.com>
parents:
776
diff
changeset
|
92 |
params = dicts.merge(params, self._params) |
949
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
93 |
|
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
94 |
# TODO(pawel.solyga): If program doesn't exist for timeline display |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
95 |
# customized error message without pointing to 'Create Timeline' |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
96 |
|
778
bc13cd968946
Added support for mutliple edit forms based on entity type
Sverre Rabbelier <srabbelier@gmail.com>
parents:
776
diff
changeset
|
97 |
program = program_logic.logic.getFromKeyName(kwargs['scope_path']) |
949
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
98 |
if program: |
07fdadbd6dc7
Check if timeline exists and when somebody tries to edit non existing timelime display error message. Add TODO regarding error message customization for Timeline. Add support for calendar widget in timeline for both gsoc and ghop programs (gsoc was hardcoded before).
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
858
diff
changeset
|
99 |
params['edit_form'] = params["edit_form_%s" % program.workflow] |
778
bc13cd968946
Added support for mutliple edit forms based on entity type
Sverre Rabbelier <srabbelier@gmail.com>
parents:
776
diff
changeset
|
100 |
|
bc13cd968946
Added support for mutliple edit forms based on entity type
Sverre Rabbelier <srabbelier@gmail.com>
parents:
776
diff
changeset
|
101 |
return super(View, self).edit(request, access_type, page_name=page_name, |
bc13cd968946
Added support for mutliple edit forms based on entity type
Sverre Rabbelier <srabbelier@gmail.com>
parents:
776
diff
changeset
|
102 |
params=params, seed=seed, **kwargs) |
793
4bde741aa2bb
Resolved a bug when editing a timeline.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
784
diff
changeset
|
103 |
|
4bde741aa2bb
Resolved a bug when editing a timeline.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
784
diff
changeset
|
104 |
def _editPost(self, request, entity, fields): |
4bde741aa2bb
Resolved a bug when editing a timeline.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
784
diff
changeset
|
105 |
"""See base.View._editPost(). |
4bde741aa2bb
Resolved a bug when editing a timeline.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
784
diff
changeset
|
106 |
""" |
4bde741aa2bb
Resolved a bug when editing a timeline.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
784
diff
changeset
|
107 |
|
4bde741aa2bb
Resolved a bug when editing a timeline.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
784
diff
changeset
|
108 |
# a timeline can only be edited, so set the scope path using entity |
4bde741aa2bb
Resolved a bug when editing a timeline.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
784
diff
changeset
|
109 |
fields['scope_path'] = entity.scope_path |
778
bc13cd968946
Added support for mutliple edit forms based on entity type
Sverre Rabbelier <srabbelier@gmail.com>
parents:
776
diff
changeset
|
110 |
|
768
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
111 |
|
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
112 |
view = View() |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
113 |
|
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
114 |
create = view.create |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
115 |
delete = view.delete |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
116 |
edit = view.edit |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
117 |
list = view.list |
002d3141ff99
Added logic and view classes for the Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff
changeset
|
118 |
public = view.public |
858
e79e7a22326f
Add an export() view, and implement it as text/text for Document.
Todd Larsen <tlarsen@google.com>
parents:
847
diff
changeset
|
119 |
export = view.export |
e79e7a22326f
Add an export() view, and implement it as text/text for Document.
Todd Larsen <tlarsen@google.com>
parents:
847
diff
changeset
|
120 |