-
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
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.