Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
9527aafd
Commit
9527aafd
authored
Jul 16, 2018
by
Renán Sosa Guillen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
views update
parent
83128bea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
views.py
catalog/views.py
+5
-3
No files found.
catalog/views.py
View file @
9527aafd
...
@@ -101,12 +101,14 @@ class SearchSubmitView(View):
...
@@ -101,12 +101,14 @@ class SearchSubmitView(View):
def
post
(
self
,
request
):
def
post
(
self
,
request
):
template
=
loader
.
get_template
(
self
.
template
)
template
=
loader
.
get_template
(
self
.
template
)
searchValue
=
request
.
POST
.
get
(
'value'
,
''
)
searchValue
=
request
.
POST
.
get
(
'value'
,
''
)
searchValue
=
self
.
strip_accents
(
searchValue
)
.
lower
()
searchValue
=
self
.
strip_accents
(
searchValue
)
.
lower
()
## A simple query for Polygon objects whose name is 'searchValue'
## A simple query for Polygon objects whose name is 'searchValue'
polygonList
=
Polygon
.
objects
.
filter
(
name__startswith
=
searchValue
)
## We exclude those polygons whose E_MUN field are NULL since at this point we're only interested
## on polygons that represent cities (Municipios).
polygonList
=
Polygon
.
objects
.
filter
(
name__startswith
=
searchValue
)
.
exclude
(
E_MUN__isnull
=
True
)
data_list
=
[]
data_list
=
[]
if
len
(
polygonList
)
>
0
:
if
len
(
polygonList
)
>
0
:
...
@@ -136,7 +138,7 @@ def regionSearched(request):
...
@@ -136,7 +138,7 @@ def regionSearched(request):
"""
"""
city_name
=
request
.
POST
[
'value'
]
city_name
=
request
.
POST
[
'value'
]
cityList
=
Polygon
.
objects
.
filter
(
name
=
city_name
)
cityList
=
Polygon
.
objects
.
filter
(
name
=
city_name
)
.
exclude
(
E_MUN__isnull
=
True
)
if
len
(
cityList
)
>
0
:
if
len
(
cityList
)
>
0
:
print
cityList
print
cityList
...
...
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