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
712a5e56
Commit
712a5e56
authored
Feb 07, 2019
by
Luis Ernesto Dominguez Uriostegui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Process completado, Luis D
parent
43723422
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
76 additions
and
131 deletions
+76
-131
forms.py
catalog/forms.py
+13
-6
0011_auto_20190206_1555.py
catalog/migrations/0011_auto_20190206_1555.py
+0
-69
0011_auto_20190206_2146.py
catalog/migrations/0011_auto_20190206_2146.py
+33
-9
0012_auto_20190206_1843.py
catalog/migrations/0012_auto_20190206_1843.py
+0
-43
0012_search_process.py
catalog/migrations/0012_search_process.py
+21
-0
models.py
catalog/models.py
+1
-1
views.py
catalog/views.py
+8
-3
db.sqlite3
db.sqlite3
+0
-0
No files found.
catalog/forms.py
View file @
712a5e56
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
django
import
forms
from
django
import
forms
import
datetime
import
datetime
from
catalog.models
import
Process
# from django import db
# db.connections.close_all()
#from django.contrib.auth.forms import UserCreationForm
#from django.contrib.auth.forms import UserCreationForm
#from django.contrib.auth.models import User
#from django.contrib.auth.models import User
#from buscador.models import Investigador, Reto
#from buscador.models import Investigador, Reto
platforms
=
[
(
"classificationScene"
,
"Classification scene"
),
all_process
=
Process
.
objects
.
all
()
(
"waterBodies"
,
"Water bodies"
),
(
"urbanSprawl"
,
"Urban sprawl"
),
platforms
=
[
]
(
"vegetationIndex"
,
"Vegetation index"
)
]
for
each_process
in
all_process
:
platforms
.
append
((
each_process
.
platform_id
,
each_process
.
name
))
#ALOS, A3, AIRSAR, AS, ERS-1, E1, ERS-2, E2, JERS-1, J1, RADARSAT-1, R1, SEASAT, SS, Sentinel-1A, SA, Sentinel-1B, SB, SMAP, SP, UAVSAR, UA.
#ALOS, A3, AIRSAR, AS, ERS-1, E1, ERS-2, E2, JERS-1, J1, RADARSAT-1, R1, SEASAT, SS, Sentinel-1A, SA, Sentinel-1B, SB, SMAP, SP, UAVSAR, UA.
class
ASFSearchForm
(
forms
.
Form
):
class
ASFSearchForm
(
forms
.
Form
):
polygon
=
forms
.
CharField
(
widget
=
forms
.
TextInput
(
attrs
=
{
'class'
:
"form-control"
}))
polygon
=
forms
.
CharField
(
widget
=
forms
.
TextInput
(
attrs
=
{
'class'
:
"form-control"
}))
...
...
catalog/migrations/0011_auto_20190206_1555.py
deleted
100644 → 0
View file @
43723422
# Generated by Django 2.0.5 on 2019-02-06 15:55
from
django.conf
import
settings
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
migrations
.
swappable_dependency
(
settings
.
AUTH_USER_MODEL
),
(
'catalog'
,
'0010_process'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Purchase'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'productList'
,
models
.
TextField
(
verbose_name
=
'JSON Product List'
)),
(
'purchased'
,
models
.
BooleanField
(
default
=
False
)),
(
'price'
,
models
.
FloatField
(
default
=
0.0
)),
],
),
migrations
.
CreateModel
(
name
=
'Search'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'startDate'
,
models
.
DateTimeField
(
verbose_name
=
'Start Date'
)),
(
'endDate'
,
models
.
DateTimeField
(
verbose_name
=
'End Date'
)),
(
'clouds'
,
models
.
IntegerField
(
default
=
4
)),
],
),
migrations
.
RenameField
(
model_name
=
'process'
,
old_name
=
'tag'
,
new_name
=
'name'
,
),
migrations
.
AddField
(
model_name
=
'process'
,
name
=
'platform'
,
field
=
models
.
ForeignKey
(
default
=
''
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'catalog.Platform'
),
),
migrations
.
AddField
(
model_name
=
'process'
,
name
=
'productLevel'
,
field
=
models
.
CharField
(
default
=
''
,
max_length
=
8
),
),
migrations
.
AddField
(
model_name
=
'search'
,
name
=
'process'
,
field
=
models
.
ForeignKey
(
default
=
''
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'catalog.Process'
),
),
migrations
.
AddField
(
model_name
=
'search'
,
name
=
'user'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
),
),
migrations
.
AddField
(
model_name
=
'purchase'
,
name
=
'search'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'catalog.Search'
),
),
migrations
.
AddField
(
model_name
=
'purchase'
,
name
=
'user'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
),
),
]
catalog/migrations/0011_auto_20190206_
155
6.py
→
catalog/migrations/0011_auto_20190206_
214
6.py
View file @
712a5e56
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-02-06
15:5
6
# Generated by Django 1.11.18 on 2019-02-06
21:4
6
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.conf
import
settings
from
django.conf
import
settings
...
@@ -19,6 +19,7 @@ class Migration(migrations.Migration):
...
@@ -19,6 +19,7 @@ class Migration(migrations.Migration):
name
=
'Purchase'
,
name
=
'Purchase'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'aggreg_date'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'productList'
,
models
.
TextField
(
verbose_name
=
'JSON Product List'
)),
(
'productList'
,
models
.
TextField
(
verbose_name
=
'JSON Product List'
)),
(
'purchased'
,
models
.
BooleanField
(
default
=
False
)),
(
'purchased'
,
models
.
BooleanField
(
default
=
False
)),
(
'price'
,
models
.
FloatField
(
default
=
0.0
)),
(
'price'
,
models
.
FloatField
(
default
=
0.0
)),
...
@@ -28,9 +29,12 @@ class Migration(migrations.Migration):
...
@@ -28,9 +29,12 @@ class Migration(migrations.Migration):
name
=
'Search'
,
name
=
'Search'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'area'
,
models
.
TextField
(
null
=
True
)),
(
'aggreg_date'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'startDate'
,
models
.
DateTimeField
(
verbose_name
=
'Start Date'
)),
(
'startDate'
,
models
.
DateTimeField
(
verbose_name
=
'Start Date'
)),
(
'endDate'
,
models
.
DateTimeField
(
verbose_name
=
'End Date'
)),
(
'endDate'
,
models
.
DateTimeField
(
verbose_name
=
'End Date'
)),
(
'clouds'
,
models
.
IntegerField
(
default
=
4
)),
(
'clouds'
,
models
.
IntegerField
(
default
=
4
)),
(
'user'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
)),
],
],
),
),
migrations
.
RenameField
(
migrations
.
RenameField
(
...
@@ -48,15 +52,35 @@ class Migration(migrations.Migration):
...
@@ -48,15 +52,35 @@ class Migration(migrations.Migration):
name
=
'productLevel'
,
name
=
'productLevel'
,
field
=
models
.
CharField
(
default
=
''
,
max_length
=
8
),
field
=
models
.
CharField
(
default
=
''
,
max_length
=
8
),
),
),
migrations
.
A
dd
Field
(
migrations
.
A
lter
Field
(
model_name
=
'
search
'
,
model_name
=
'
polygon
'
,
name
=
'
process
'
,
name
=
'
name
'
,
field
=
models
.
ForeignKey
(
default
=
''
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'catalog.Process
'
),
field
=
models
.
CharField
(
max_length
=
100
,
verbose_name
=
'Polygon Name
'
),
),
),
migrations
.
AddField
(
migrations
.
AlterField
(
model_name
=
'search'
,
model_name
=
'polygon'
,
name
=
'user'
,
name
=
'source'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
),
field
=
models
.
CharField
(
max_length
=
100
,
null
=
True
,
verbose_name
=
'Source'
),
),
migrations
.
AlterField
(
model_name
=
'product_l1c'
,
name
=
'file_path'
,
field
=
models
.
CharField
(
max_length
=
150
),
),
migrations
.
AlterField
(
model_name
=
'product_l1c'
,
name
=
'identifier'
,
field
=
models
.
CharField
(
max_length
=
100
),
),
migrations
.
AlterField
(
model_name
=
'product_l2a'
,
name
=
'file_path'
,
field
=
models
.
CharField
(
max_length
=
150
),
),
migrations
.
AlterField
(
model_name
=
'product_l2a'
,
name
=
'identifier'
,
field
=
models
.
CharField
(
max_length
=
100
),
),
),
migrations
.
AddField
(
migrations
.
AddField
(
model_name
=
'purchase'
,
model_name
=
'purchase'
,
...
...
catalog/migrations/0012_auto_20190206_1843.py
deleted
100644 → 0
View file @
43723422
# Generated by Django 2.1.5 on 2019-02-06 18:43
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'catalog'
,
'0011_auto_20190206_1555'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'polygon'
,
name
=
'name'
,
field
=
models
.
CharField
(
max_length
=
100
,
verbose_name
=
'Polygon Name'
),
),
migrations
.
AlterField
(
model_name
=
'polygon'
,
name
=
'source'
,
field
=
models
.
CharField
(
max_length
=
100
,
null
=
True
,
verbose_name
=
'Source'
),
),
migrations
.
AlterField
(
model_name
=
'product_l1c'
,
name
=
'file_path'
,
field
=
models
.
CharField
(
max_length
=
150
),
),
migrations
.
AlterField
(
model_name
=
'product_l1c'
,
name
=
'identifier'
,
field
=
models
.
CharField
(
max_length
=
100
),
),
migrations
.
AlterField
(
model_name
=
'product_l2a'
,
name
=
'file_path'
,
field
=
models
.
CharField
(
max_length
=
150
),
),
migrations
.
AlterField
(
model_name
=
'product_l2a'
,
name
=
'identifier'
,
field
=
models
.
CharField
(
max_length
=
100
),
),
]
catalog/migrations/0012_search_process.py
0 → 100644
View file @
712a5e56
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-02-07 18:32
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'catalog'
,
'0011_auto_20190206_2146'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'search'
,
name
=
'process'
,
field
=
models
.
ForeignKey
(
default
=
''
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'catalog.Process'
),
),
]
catalog/models.py
View file @
712a5e56
...
@@ -60,7 +60,7 @@ class Search(models.Model):
...
@@ -60,7 +60,7 @@ class Search(models.Model):
aggreg_date
=
models
.
DateTimeField
(
auto_now
=
True
)
# date of product aggregation
aggreg_date
=
models
.
DateTimeField
(
auto_now
=
True
)
# date of product aggregation
startDate
=
models
.
DateTimeField
(
verbose_name
=
'Start Date'
)
startDate
=
models
.
DateTimeField
(
verbose_name
=
'Start Date'
)
endDate
=
models
.
DateTimeField
(
verbose_name
=
'End Date'
)
endDate
=
models
.
DateTimeField
(
verbose_name
=
'End Date'
)
#process = models.ForeignKey(Process, on_delete=models.CASCADE, default='')
process
=
models
.
ForeignKey
(
Process
,
on_delete
=
models
.
CASCADE
,
default
=
''
)
#Desbloqueo cambio de Sergio
clouds
=
models
.
IntegerField
(
default
=
4
)
clouds
=
models
.
IntegerField
(
default
=
4
)
...
...
catalog/views.py
View file @
712a5e56
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
catalog.forms
import
ASFSearchForm
from
catalog.forms
import
ASFSearchForm
from
catalog.models
import
Polygon
,
CartProduct
,
Product_l1c
,
Search
,
Purchase
from
catalog.models
import
Polygon
,
CartProduct
,
Product_l1c
,
Search
,
Purchase
,
Process
from
django.http
import
HttpResponse
,
JsonResponse
,
HttpResponseRedirect
from
django.http
import
HttpResponse
,
JsonResponse
,
HttpResponseRedirect
from
django.urls
import
reverse
from
django.urls
import
reverse
from
django.views.generic.base
import
View
from
django.views.generic.base
import
View
...
@@ -14,7 +14,7 @@ from django.core import management
...
@@ -14,7 +14,7 @@ from django.core import management
import
requests
,
json
,
unicodedata
,
sys
,
base64
import
requests
,
json
,
unicodedata
,
sys
,
base64
import
sys
import
sys
sys
.
path
.
append
(
'
../GeoSentinel/
'
)
sys
.
path
.
append
(
'
/home/luis/django-apps/Geosentinel
'
)
from
geosentinel
import
APISentinel
,
polygonToBox
from
geosentinel
import
APISentinel
,
polygonToBox
sentinel
=
APISentinel
.
APISentinel
(
'emmhp'
,
'geoemm29'
)
sentinel
=
APISentinel
.
APISentinel
(
'emmhp'
,
'geoemm29'
)
...
@@ -108,13 +108,18 @@ def productList(request):
...
@@ -108,13 +108,18 @@ def productList(request):
'uuid'
:
products
[
p
][
'uuid'
],
'uuid'
:
products
[
p
][
'uuid'
],
'img'
:
img_preview
'img'
:
img_preview
})
})
#Se tiene que pasar a Search el objeto completo correspondiente al process
index
=
Process
.
objects
.
filter
(
platform_id
=
process
)
proceso
=
index
[
0
]
if
(
len
(
catalog
)
!=
0
):
if
(
len
(
catalog
)
!=
0
):
listSearch
=
Search
(
listSearch
=
Search
(
user
=
user
,
user
=
user
,
startDate
=
init_date
,
startDate
=
init_date
,
endDate
=
end_date
,
endDate
=
end_date
,
#process = process,
process
=
proceso
,
#Aquí pasar el objeto completo de Process Desbloqueo cambio de Sergio
clouds
=
clouds
,
clouds
=
clouds
,
area
=
area
area
=
area
)
)
...
...
db.sqlite3
View file @
712a5e56
No preview for this file type
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