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
ec00a8c7
Commit
ec00a8c7
authored
Jul 19, 2018
by
Renán Sosa Guillen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes is product management
parent
6766ce06
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
271 additions
and
16 deletions
+271
-16
populate_products.py
catalog/management/commands/populate_products.py
+246
-0
models.py
catalog/models.py
+22
-14
views.py
catalog/views.py
+3
-2
No files found.
catalog/management/commands/populate_products.py
0 → 100644
View file @
ec00a8c7
This diff is collapsed.
Click to expand it.
catalog/models.py
View file @
ec00a8c7
...
@@ -24,3 +24,11 @@ class Polygon(models.Model):
...
@@ -24,3 +24,11 @@ class Polygon(models.Model):
E_MUN
=
models
.
CharField
(
verbose_name
=
"City Stratum"
,
max_length
=
10
,
default
=
''
)
E_MUN
=
models
.
CharField
(
verbose_name
=
"City Stratum"
,
max_length
=
10
,
default
=
''
)
E_AGEB
=
models
.
CharField
(
verbose_name
=
"AGEB Stratum"
,
max_length
=
10
,
default
=
''
)
E_AGEB
=
models
.
CharField
(
verbose_name
=
"AGEB Stratum"
,
max_length
=
10
,
default
=
''
)
wkt_polygon
=
models
.
TextField
(
default
=
''
)
wkt_polygon
=
models
.
TextField
(
default
=
''
)
class
Product
(
models
.
Model
):
uuid
=
models
.
CharField
(
max_length
=
50
,
default
=
''
)
identifier
=
models
.
CharField
(
max_length
=
50
,
default
=
''
)
file_path
=
models
.
CharField
(
max_length
=
50
,
default
=
''
)
json
=
models
.
TextField
(
default
=
''
)
catalog/views.py
View file @
ec00a8c7
...
@@ -77,8 +77,9 @@ def productList(request):
...
@@ -77,8 +77,9 @@ def productList(request):
# se crea una lista de objetos del catalogo
# se crea una lista de objetos del catalogo
catalog
=
[]
catalog
=
[]
for
p
in
products
:
for
p
in
products
:
img_link
=
products
[
p
][
'link_icon'
]
if
products
.
keys
()
.
index
(
p
)
==
0
:
print
json
.
dumps
(
products
[
p
],
indent
=
3
,
sort_keys
=
True
,
default
=
date_handler
)
img_link
=
img_link
[:
img_link
.
find
(
"/"
)
+
2
]
+
"emmhp:geoemm29@"
+
img_link
[
img_link
.
find
(
"/"
)
+
2
:]
# img_link = products[p]['link_icon']
# img_link = img_link[:img_link.find("/")+2] + "emmhp:geoemm29@" + img_link[img_link.find("/")+2:]
catalog
.
append
({
catalog
.
append
({
'process'
:
process
,
'process'
:
process
,
...
...
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