-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
231 additions
and
133 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,23 +12,21 @@ volumes: | |
x-common-django: | ||
&default-common-django | ||
image: kartoza/${COMPOSE_PROJECT_NAME:-django_project}:${DJANGO_TAG:-1.0.0} | ||
env_file: | ||
- .env | ||
environment: | ||
- DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE:-core.settings.dev} | ||
|
||
- ADMIN_USERNAME=${ADMIN_USERNAME:-admin} | ||
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin} | ||
- ADMIN_EMAIL=${ADMIN_EMAIL:[email protected]} | ||
|
||
- DATABASE_NAME=${DATABASE_NAME:-django} | ||
- DATABASE_USERNAME=${DATABASE_USERNAME:-docker} | ||
- DATABASE_PASSWORD=${DATABASE_PASSWORD:-docker} | ||
- DATABASE_HOST=${DATABASE_HOST:-db} | ||
- DATABASE_PORT=${DATABASE_PORT:-5432} | ||
- REDIS_HOST=${REDIS_HOST:-redis} | ||
- REDIS_PASSWORD=${REDIS_PASSWORD:-redis_password} | ||
|
||
- RABBITMQ_HOST=${RABBITMQ_HOST:-rabbitmq} | ||
- SENTRY_DSN=${SENTRY_DSN:-} | ||
- SECRET_KEY=SECRET_KEY | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# coding=utf-8 | ||
""" | ||
Tomorrow Now GAP. | ||
.. note:: General models | ||
""" | ||
|
||
from django.db import models | ||
|
||
|
||
class Definition(models.Model): | ||
"""Abstract model for Model that has name and description. | ||
Attributes: | ||
name (str): Name of object. | ||
description (str): Description of object. | ||
""" | ||
|
||
name = models.CharField( | ||
max_length=512 | ||
) | ||
description = models.TextField( | ||
null=True, blank=True | ||
) | ||
|
||
def __str__(self): | ||
return self.name | ||
|
||
class Meta: # noqa: D106 | ||
abstract = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,63 @@ | ||
# coding=utf-8 | ||
""" | ||
Tomorrow Now GAP. | ||
.. note:: Admins | ||
""" | ||
from django.contrib import admin | ||
|
||
# Register your models here. | ||
from .models import ( | ||
Attribute, Country, Provider, Measurement, Station | ||
) | ||
|
||
|
||
@admin.register(Attribute) | ||
class AttributeAdmin(admin.ModelAdmin): | ||
"""Attribute admin.""" | ||
|
||
list_display = ( | ||
'name', 'description' | ||
) | ||
search_fields = ('name',) | ||
|
||
|
||
@admin.register(Country) | ||
class CountryAdmin(admin.ModelAdmin): | ||
"""Country admin.""" | ||
|
||
list_display = ( | ||
'name', 'description' | ||
) | ||
search_fields = ('name',) | ||
|
||
|
||
@admin.register(Provider) | ||
class ProviderAdmin(admin.ModelAdmin): | ||
"""Provider admin.""" | ||
|
||
list_display = ( | ||
'name', 'description' | ||
) | ||
search_fields = ('name',) | ||
|
||
|
||
@admin.register(Measurement) | ||
class MeasurementAdmin(admin.ModelAdmin): | ||
"""Measurement admin.""" | ||
|
||
list_display = ( | ||
'station', 'attribute', 'date', 'value' | ||
) | ||
list_filter = ('station', 'attribute') | ||
search_fields = ('name',) | ||
|
||
|
||
@admin.register(Station) | ||
class StationAdmin(admin.ModelAdmin): | ||
"""Station admin.""" | ||
|
||
list_display = ( | ||
'name', 'country', 'provider' | ||
) | ||
list_filter = ('country',) | ||
search_fields = ('name',) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
# coding=utf-8 | ||
""" | ||
Tomorrow Now GAP. | ||
.. note:: App Config | ||
""" | ||
|
||
from django.apps import AppConfig | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
|
||
class GroundObservationsConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
"""App Config for GroundObservations.""" | ||
|
||
name = 'ground_observations' | ||
verbose_name = _('Ground Observations') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.