Add Redis service and Celery configuration to Docker setup
- Introduced Redis service in both docker-compose files for production and development. - Updated web and celery services to use Redis as the broker and result backend. - Added necessary environment variables for Celery in settings.py. - Included new tasks and soil_data apps in Django settings and updated URL routing. - Updated requirements.txt to include Celery and Redis dependencies.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
from django.contrib import admin
|
||||
from .models import SoilDepthData, SoilLocation
|
||||
|
||||
|
||||
class SoilDepthDataInline(admin.TabularInline):
|
||||
model = SoilDepthData
|
||||
extra = 0
|
||||
readonly_fields = ("depth_label", "bdod", "cec", "cfvo", "clay", "nitrogen", "ocd", "ocs", "phh2o", "sand", "silt", "soc", "wv0010", "wv0033", "wv1500")
|
||||
|
||||
|
||||
@admin.register(SoilLocation)
|
||||
class SoilLocationAdmin(admin.ModelAdmin):
|
||||
list_display = ("id", "latitude", "longitude", "is_complete", "created_at")
|
||||
list_filter = ("created_at",)
|
||||
search_fields = ("latitude", "longitude")
|
||||
readonly_fields = ("created_at", "updated_at")
|
||||
inlines = [SoilDepthDataInline]
|
||||
|
||||
|
||||
@admin.register(SoilDepthData)
|
||||
class SoilDepthDataAdmin(admin.ModelAdmin):
|
||||
list_display = ("id", "soil_location", "depth_label", "bdod", "cec", "phh2o", "clay", "sand", "silt")
|
||||
list_filter = ("depth_label",)
|
||||
search_fields = ("soil_location__latitude", "soil_location__longitude")
|
||||
Reference in New Issue
Block a user