kopia lustrzana https://github.com/hholzgra/maposmatic/
Porównaj commity
3 Commity
ee5ad39915
...
d7972606e1
Autor | SHA1 | Data |
---|---|---|
Hartmut Holzgraefe | d7972606e1 | |
Hartmut Holzgraefe | 2a3c3f9f2c | |
Hartmut Holzgraefe | 7cc0430fda |
|
@ -190,13 +190,15 @@ def _jobs_post(request):
|
||||||
job.paper_width_mm = 210
|
job.paper_width_mm = 210
|
||||||
job.paper_height_mm = 297
|
job.paper_height_mm = 297
|
||||||
|
|
||||||
# TODO: either both or none of width/height need to be set
|
if 'paper_width' in input or 'paper_height' in input:
|
||||||
# TODO: size and width/height are mutually exclusive
|
if 'paper_size' in input:
|
||||||
if 'paper_width' in input:
|
result['error']['paper_size'] = "paper_size and paper_width/height are mutually exclusive"
|
||||||
job.paper_width_mm = input['paper_width']
|
elif 'paper_width' in input and 'paper_height' in input:
|
||||||
if 'paper_height' in input:
|
job.paper_width_mm = input['paper_width']
|
||||||
job.paper_height_mm = input['paper_height']
|
job.paper_height_mm = input['paper_height']
|
||||||
if 'paper_size' in input:
|
else:
|
||||||
|
result['error']['paper_width'] = "both paper_width and paper_height need to be given"
|
||||||
|
elif 'paper_size' in input:
|
||||||
try:
|
try:
|
||||||
_ocitysmap = ocitysmap.OCitySMap(www.settings.OCITYSMAP_CFG_PATH)
|
_ocitysmap = ocitysmap.OCitySMap(www.settings.OCITYSMAP_CFG_PATH)
|
||||||
p = _ocitysmap.get_paper_size_by_name(input['paper_size'])
|
p = _ocitysmap.get_paper_size_by_name(input['paper_size'])
|
||||||
|
|
|
@ -208,7 +208,7 @@ class MapRenderingJobForm(forms.ModelForm):
|
||||||
if mode == 'admin':
|
if mode == 'admin':
|
||||||
# TODO as bounding box override now exists (Issue #24)
|
# TODO as bounding box override now exists (Issue #24)
|
||||||
# we need to do the same bbox checks here as in
|
# we need to do the same bbox checks here as in
|
||||||
# the mode=bbox section below?
|
# the mode=bbox section below?
|
||||||
if city == "":
|
if city == "":
|
||||||
msg = _(u"Administrative city required")
|
msg = _(u"Administrative city required")
|
||||||
self._errors["administrative_city"] = ErrorList([msg])
|
self._errors["administrative_city"] = ErrorList([msg])
|
||||||
|
|
|
@ -195,8 +195,7 @@ LANGUAGE_FLAGS = {
|
||||||
|
|
||||||
LOCALE_PATHS = [
|
LOCALE_PATHS = [
|
||||||
os.path.join(PROJECT_PATH, 'locale'),
|
os.path.join(PROJECT_PATH, 'locale'),
|
||||||
# TODO ocitysmap path should not be hardcoded
|
os.path.join(OCITYSMAP_PATH, 'locale'),
|
||||||
os.path.join('/home/maposmatic/ocitysmap', 'locale'),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Associate a Django language code with:
|
# Associate a Django language code with:
|
||||||
|
|
Ładowanie…
Reference in New Issue