Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
intranet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nounous-archives
intranet
Commits
0be37a6d
Commit
0be37a6d
authored
Oct 13, 2017
by
Gabriel Detraz
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Le droit imprimeur permet de lancer les impressions en A3
parent
616da1ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
impressions/forms.py
impressions/forms.py
+6
-0
impressions/views.py
impressions/views.py
+2
-1
No files found.
impressions/forms.py
View file @
0be37a6d
...
...
@@ -134,6 +134,12 @@ class PrintForm(forms.Form):
del
champ
# Gruiiik
copies
.
widget
.
attrs
[
"onKeyUp"
]
=
javascript_function
def
__init__
(
self
,
*
args
,
**
kwargs
):
full_choice_paper
=
kwargs
.
pop
(
'full_choice_paper'
)
super
(
PrintForm
,
self
).
__init__
(
*
args
,
**
kwargs
)
if
full_choice_paper
:
self
.
fields
[
'format'
].
choices
=
[(
'A4'
,
u
'A4'
),
(
'A3'
,
u
'A3'
)]
def
clean
(
self
):
"""Certains valeurs des paramètres sont incompatibles."""
out
=
forms
.
Form
.
clean
(
self
)
...
...
impressions/views.py
View file @
0be37a6d
...
...
@@ -14,6 +14,7 @@ from django.shortcuts import render_to_response,render
from
django.views.generic.detail
import
DetailView
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.forms
import
formset_factory
from
functools
import
partial
,
wraps
# Paginateur , afin d'éviter de trop longues pages
from
django.core.paginator
import
Paginator
,
EmptyPage
,
PageNotAnInteger
...
...
@@ -163,7 +164,7 @@ def view(request):
if
uploadform
.
is_valid
():
initial_data
=
[{
'filenom'
:
form
.
cleaned_data
[
"fichier"
].
name
,
'pageno'
:
form
.
cleaned_data
[
"pageno"
],}
for
form
in
uploadform
if
form
.
cleaned_data
.
has_key
(
"fichier"
)]
printform
=
formset_factory
(
PrintForm
,
extra
=
0
)
printform
=
formset_factory
(
wraps
(
PrintForm
)(
partial
(
PrintForm
,
full_choice_paper
=
is_imprimeur
(
request
)))
,
extra
=
0
)
printform
=
printform
(
initial
=
initial_data
)
return
render
(
request
,
"impressions/print.html"
,
{
'printform'
:
printform
,
...
...
Gabriel Detraz
@detraz
mentioned in commit
e084a59e
·
Oct 18, 2017
mentioned in commit
e084a59e
mentioned in commit e084a59eeb8bb0483e1b3108ec455fc2d6a88c83
Toggle commit list
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