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
3a0a62b1
Commit
3a0a62b1
authored
Jun 07, 2019
by
Emmanuel René Huchim Puc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reportes de mario y oscar en demo
parent
72ad25cd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
13 deletions
+24
-13
views.py
reports/views.py
+24
-13
No files found.
reports/views.py
View file @
3a0a62b1
...
...
@@ -109,14 +109,25 @@ def Reports(request):
folders
=
[]
zip
=
""
if
(
request
.
user
.
username
==
"demo"
):
product_list
=
Purchase
.
objects
.
values
(
'id'
,
'productList'
,
'aggreg_date'
,
'search__clouds'
,
'search__startDate'
,
'search__endDate'
,
'search__process_id__name'
,
'search__search_name'
,
'is_public'
,
'name'
,
'description'
,
'user__email'
)
.
filter
(
user_id__in
=
[
request
.
user
.
id
,
37
,
2
],
purchased
=
1
)
else
:
product_list
=
Purchase
.
objects
.
values
(
'id'
,
'productList'
,
'aggreg_date'
,
'search__clouds'
,
'search__startDate'
,
'search__endDate'
,
'search__process_id__name'
,
'search__search_name'
,
'is_public'
,
'name'
,
'description'
,
'user__email'
)
.
filter
(
user_id
=
request
.
user
.
id
,
purchased
=
1
)
product_list
=
Purchase
.
objects
.
values
(
'id'
,
'productList'
,
'aggreg_date'
,
'search__clouds'
,
'search__startDate'
,
'search__endDate'
,
'search__process_id__name'
,
'search__search_name'
,
'is_public'
,
'name'
,
'description'
)
.
filter
(
user_id
=
request
.
user
.
id
,
purchased
=
1
)
for
producto
in
product_list
:
log_info
=
USERS_PATH
+
request
.
user
.
email
+
"/"
+
str
(
producto
[
'id'
])
+
"/L2ASCL_AreaProcessing.log"
log_info
=
USERS_PATH
+
producto
[
'user__email'
]
+
"/"
+
str
(
producto
[
'id'
])
+
"/L2ASCL_AreaProcessing.log"
#####################################################
# progress bar #
...
...
@@ -150,7 +161,7 @@ def Reports(request):
initial_folder
=
"."
absolute_path
=
USERS_PATH
+
request
.
user
.
email
+
"/"
+
str
(
producto
[
'id'
])
+
"/"
absolute_path
=
USERS_PATH
+
producto
[
'user__email'
]
+
"/"
+
str
(
producto
[
'id'
])
+
"/"
if
not
os
.
path
.
exists
(
absolute_path
):
print
(
"folder out noes not exists"
)
else
:
...
...
@@ -168,12 +179,12 @@ def Reports(request):
zip_path
=
USERS_PATH
+
request
.
user
.
email
+
"/"
+
str
(
producto
[
'id'
])
zip_path
=
USERS_PATH
+
producto
[
'user__email'
]
+
"/"
+
str
(
producto
[
'id'
])
# print(zip_path)
# "../ static / reports / tmpImages / repsat_test_dev / umorales @ centrogeo.edu.mx / "+str(producto['id']) / myzip.zip"
wkt
=
USERS_PATH
+
request
.
user
.
email
+
"/"
+
str
(
producto
[
'id'
])
+
"/findProducts.json"
wkt
=
USERS_PATH
+
producto
[
'user__email'
]
+
"/"
+
str
(
producto
[
'id'
])
+
"/findProducts.json"
with
open
(
wkt
,
'r'
)
as
jsonfile
:
polygon
=
json
.
load
(
jsonfile
)
...
...
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