2018-06-29 03:16:31 +00:00
|
|
|
"""printer.settings
|
2018-10-20 12:41:33 +00:00
|
|
|
Define variables used in printer app
|
2018-06-29 03:16:31 +00:00
|
|
|
"""
|
2018-10-25 23:30:21 +00:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
2018-10-20 12:41:33 +00:00
|
|
|
from preferences.models import OptionalPrinter
|
2018-06-29 03:16:31 +00:00
|
|
|
|
2018-10-20 12:41:33 +00:00
|
|
|
settings = OptionalPrinter.objects.get()
|
2018-06-29 03:16:31 +00:00
|
|
|
|
2018-10-20 12:41:33 +00:00
|
|
|
MAX_PRINTFILE_SIZE = settings.max_size * 1024 * 1024 # 25 MB
|
2018-06-29 03:16:31 +00:00
|
|
|
ALLOWED_TYPES = ['application/pdf']
|
2018-09-08 12:04:44 +00:00
|
|
|
|
|
|
|
|
2018-10-20 13:52:38 +00:00
|
|
|
A3_enabled = settings.A3_enabled
|
|
|
|
booklet_enabled = settings.booklet_enabled
|
|
|
|
color_enabled = settings.color_enabled
|
|
|
|
stapling_enabled = settings.stapling_enabled
|
|
|
|
perforation_enabled = settings.perforation_enabled
|
|
|
|
|
|
|
|
FORMAT_AVAILABLE = (
|
2018-10-25 23:30:21 +00:00
|
|
|
('A4', _('A4')),
|
|
|
|
('A3', _('A3')),
|
2018-10-20 13:52:38 +00:00
|
|
|
)
|
|
|
|
COLOR_CHOICES = (
|
2018-10-25 23:30:21 +00:00
|
|
|
('Greyscale', _('Greyscale')),
|
|
|
|
('Color', _('Color'))
|
2018-10-20 13:52:38 +00:00
|
|
|
)
|
|
|
|
DISPOSITIONS_AVAILABLE = (
|
2018-10-25 23:30:21 +00:00
|
|
|
('TwoSided', _('Two sided')),
|
|
|
|
('OneSided', _('One sided')),
|
|
|
|
('Booklet', _('Booklet'))
|
2018-10-20 13:52:38 +00:00
|
|
|
)
|
|
|
|
STAPLING_OPTIONS = (
|
2018-10-25 23:30:21 +00:00
|
|
|
('None', _('None')),
|
|
|
|
('TopLeft', _('One top left')),
|
|
|
|
('TopRight', _('One top right')),
|
|
|
|
('LeftSided', _('Two left sided')),
|
|
|
|
('RightSided', _('Two right sided'))
|
2018-10-20 13:52:38 +00:00
|
|
|
)
|
|
|
|
PERFORATION_OPTIONS = (
|
2018-10-25 23:30:21 +00:00
|
|
|
('None', _('None')),
|
|
|
|
('TwoLeftSidedHoles', _('Two left sided holes')),
|
|
|
|
('TwoRightSidedHoles', _('Two right sided holes')),
|
|
|
|
('TwoTopHoles', _('Two top holes')),
|
|
|
|
('TwoBottomHoles', _('Two bottom holes')),
|
|
|
|
('FourLeftSidedHoles', _('Four left sided holes')),
|
|
|
|
('FourRightSidedHoles', _('Four right sided holes'))
|
2018-10-20 13:52:38 +00:00
|
|
|
)
|
2018-09-08 12:04:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Config
|
|
|
|
|
|
|
|
## Depreciation
|
2018-10-20 12:41:33 +00:00
|
|
|
depr = settings.depreciation_coef
|
2018-09-08 12:04:44 +00:00
|
|
|
|
|
|
|
PRICES = {
|
|
|
|
'Depreciation': depr,
|
2018-10-20 12:41:33 +00:00
|
|
|
'A3': settings.A3_price,
|
|
|
|
'A4': settings.A4_price,
|
|
|
|
'Color': settings.Color_price + depr,
|
|
|
|
'Greyscale': settings.Greyscale_price + depr,
|
|
|
|
'Staples': settings.Staples_price,
|
2018-09-08 12:04:44 +00:00
|
|
|
}
|