Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code cleanup and extracting generator ID
- Loading branch information
1 parent
f9f3801
commit ef9bc9b
Showing
3 changed files
with
31 additions
and
20 deletions.
There are no files selected for viewing
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,33 +1,35 @@ | ||
from django.contrib import admin | ||
from django.contrib.gis import admin | ||
|
||
from .models import DataPoint, DataBundle, DataSource, DataSourceGroup, \ | ||
DataPointVisualizations, ReportJob | ||
|
||
@admin.register(DataPointVisualizations) | ||
class DataPointVisualizationsAdmin(admin.ModelAdmin): | ||
class DataPointVisualizationsAdmin(admin.OSMGeoAdmin): | ||
list_display = ('source', 'generator_identifier', 'last_updated',) | ||
list_filter = ('source', 'generator_identifier', 'last_updated',) | ||
|
||
@admin.register(DataPoint) | ||
class DataPointAdmin(admin.ModelAdmin): | ||
class DataPointAdmin(admin.OSMGeoAdmin): | ||
openlayers_url = 'https://openlayers.org/api/2.13.1/OpenLayers.js' | ||
|
||
list_display = ('source', 'generator_identifier', 'created', 'recorded',) | ||
list_filter = ('created', 'recorded', 'generator_identifier',) | ||
|
||
@admin.register(DataBundle) | ||
class DataBundleAdmin(admin.ModelAdmin): | ||
class DataBundleAdmin(admin.OSMGeoAdmin): | ||
list_display = ('recorded', 'processed',) | ||
list_filter = ('processed', 'recorded',) | ||
|
||
@admin.register(DataSourceGroup) | ||
class DataBundleAdmin(admin.ModelAdmin): | ||
class DataSourceGroupAdmin(admin.OSMGeoAdmin): | ||
list_display = ('name',) | ||
|
||
@admin.register(DataSource) | ||
class DataBundleAdmin(admin.ModelAdmin): | ||
class DataSourceAdmin(admin.OSMGeoAdmin): | ||
list_display = ('name', 'identifier', 'group') | ||
list_filter = ('group',) | ||
|
||
@admin.register(ReportJob) | ||
class ReportJobAdmin(admin.ModelAdmin): | ||
class ReportJobAdmin(admin.OSMGeoAdmin): | ||
list_display = ('requester', 'requested', 'started', 'completed') | ||
list_filter = ('requested', 'started', 'completed',) |
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