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
9c0ca0a5
Commit
9c0ca0a5
authored
Feb 06, 2019
by
Luis Ernesto Dominguez Uriostegui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modelos Platform y Process conectados a la base de datos y a /admin
parent
5d275711
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
103 additions
and
6 deletions
+103
-6
settings.py
GeoInt_SIDT/settings.py
+13
-0
admin.py
catalog/admin.py
+16
-0
forms.py
catalog/forms.py
+2
-2
0011_auto_20190206_1556.py
catalog/migrations/0011_auto_20190206_1556.py
+71
-0
models.py
catalog/models.py
+1
-4
db.sqlite3
db.sqlite3
+0
-0
No files found.
GeoInt_SIDT/settings.py
View file @
9c0ca0a5
...
...
@@ -79,6 +79,17 @@ WSGI_APPLICATION = 'GeoInt_SIDT.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
# 'NAME': 'repsatdb',
# 'USER': 'root',
# 'PASSWORD': 'root',
# 'HOST': 'localhost',
# 'PORT': '',
# }
# }
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.sqlite3'
,
...
...
@@ -87,6 +98,8 @@ DATABASES = {
}
# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
...
...
catalog/admin.py
View file @
9c0ca0a5
...
...
@@ -3,4 +3,20 @@ from __future__ import unicode_literals
from
django.contrib
import
admin
# Las siguientes dos líneas evita el error: database is locked
from
django
import
db
db
.
connections
.
close_all
()
# Register your models here.
from
catalog.models
import
Process
from
catalog.models
import
Platform
#admin.site.register(Publisher)
class
ProcessAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'name'
,
'platform'
,
'productLevel'
)
admin
.
site
.
register
(
Process
,
ProcessAdmin
)
class
PlatformAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'name'
,
'acronym'
)
admin
.
site
.
register
(
Platform
,
PlatformAdmin
)
catalog/forms.py
View file @
9c0ca0a5
...
...
@@ -5,10 +5,10 @@ import datetime
#from django.contrib.auth.models import User
#from buscador.models import Investigador, Reto
platforms
=
[
(
"
sentinel2
"
,
"Classification scene"
),
(
"
classificationScene
"
,
"Classification scene"
),
(
"waterBodies"
,
"Water bodies"
),
(
"urbanSprawl"
,
"Urban sprawl"
),
(
"vegIndex"
,
"Vegetation index"
)
(
"veg
etation
Index"
,
"Vegetation index"
)
]
#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
):
...
...
catalog/migrations/0011_auto_20190206_1556.py
0 → 100644
View file @
9c0ca0a5
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-02-06 15:56
from
__future__
import
unicode_literals
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/models.py
View file @
9c0ca0a5
...
...
@@ -51,7 +51,7 @@ class CartProduct(models.Model):
class
Process
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
50
)
platform
=
models
.
ForeignKey
(
Platform
,
on_delete
=
models
.
CASCADE
,
default
=
''
)
productLevel
=
models
.
CharField
(
max_length
=
8
)
productLevel
=
models
.
CharField
(
max_length
=
8
,
default
=
''
)
class
Search
(
models
.
Model
):
user
=
models
.
ForeignKey
(
User
,
on_delete
=
models
.
CASCADE
)
...
...
@@ -66,6 +66,3 @@ class Purchase(models.Model):
productList
=
models
.
TextField
(
verbose_name
=
"JSON Product List"
)
purchased
=
models
.
BooleanField
(
default
=
False
)
price
=
models
.
FloatField
(
default
=
0.0
)
db.sqlite3
View file @
9c0ca0a5
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