Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nuages
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etch
nuages
Commits
2e622212
Commit
2e622212
authored
Jul 17, 2013
by
Christophe Siraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Respect minutes in datetimewidget. Auto fill last choice + 1 day.
parent
431c63b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
meetingpoll/forms.py
meetingpoll/forms.py
+0
-1
meetingpoll/views.py
meetingpoll/views.py
+7
-3
No files found.
meetingpoll/forms.py
View file @
2e622212
...
@@ -7,7 +7,6 @@ from datetime import datetime
...
@@ -7,7 +7,6 @@ from datetime import datetime
dateTimeOptions
=
{
dateTimeOptions
=
{
'weekStart'
:
'1'
,
'weekStart'
:
'1'
,
'startView'
:
'3'
,
'startView'
:
'3'
,
'minView'
:
'1'
,
'startDate'
:
datetime
.
today
().
date
(),
'startDate'
:
datetime
.
today
().
date
(),
'autoclose'
:
'true'
,
'autoclose'
:
'true'
,
'todayHighlight'
:
'true'
'todayHighlight'
:
'true'
...
...
meetingpoll/views.py
View file @
2e622212
...
@@ -9,7 +9,7 @@ from django.template import RequestContext
...
@@ -9,7 +9,7 @@ from django.template import RequestContext
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
.forms
import
UserProfileForm
,
PollForm
,
ChoiceForm
,
VoteForm
,
BulletinForm
from
.forms
import
UserProfileForm
,
PollForm
,
ChoiceForm
,
VoteForm
,
BulletinForm
from
.models
import
Poll
,
Choice
,
Vote
,
Bulletin
from
.models
import
Poll
,
Choice
,
Vote
,
Bulletin
from
datetime
import
timedelta
def
email_notify
(
poll
,
voter
):
def
email_notify
(
poll
,
voter
):
"""Send email notification"""
"""Send email notification"""
...
@@ -72,8 +72,12 @@ def editchoices(request, poll_id):
...
@@ -72,8 +72,12 @@ def editchoices(request, poll_id):
_
(
"There are some errors in the form you posted."
))
_
(
"There are some errors in the form you posted."
))
if
Choice
.
objects
.
filter
(
poll
=
poll_id
).
count
()
==
0
:
if
Choice
.
objects
.
filter
(
poll
=
poll_id
).
count
()
==
0
:
choiceFormset
=
get_formset
(
ChoiceForm
,
extra
=
2
,
can_delete
=
True
)
choiceFormset
=
get_formset
(
ChoiceForm
,
extra
=
1
,
can_delete
=
True
)
formset
=
choiceFormset
(
instance
=
poll
)
formset
=
choiceFormset
(
instance
=
poll
)
else
:
last_choice
=
poll
.
choice_set
.
all
().
latest
(
'choice'
).
choice
proposal
=
last_choice
+
timedelta
(
days
=
1
)
formset
=
choiceFormset
(
instance
=
poll
,
initial
=
[{
'choice'
:
proposal
}])
return
render
(
request
,
return
render
(
request
,
'meetingpoll/choice_form.html'
,
'meetingpoll/choice_form.html'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment