2023-06-26 22:06:05 +08:00
|
|
|
from django.contrib import admin
|
2023-06-26 23:50:55 +08:00
|
|
|
from .models import StudentStatus
|
2023-07-10 17:06:43 +08:00
|
|
|
from leaflet.admin import LeafletGeoAdmin
|
2023-06-26 22:06:05 +08:00
|
|
|
|
2023-07-14 23:55:54 +08:00
|
|
|
|
|
|
|
class StudentStatusAdmin(LeafletGeoAdmin):
|
|
|
|
# define which fields are required
|
|
|
|
def get_form(self, request, obj=None, **kwargs):
|
|
|
|
form = super(StudentStatusAdmin, self).get_form(request, obj, **kwargs)
|
|
|
|
form.base_fields['landmark'].required = False
|
|
|
|
return form
|
|
|
|
|
|
|
|
|
|
|
|
# Register the new StudentStatus model
|
|
|
|
admin.site.register(StudentStatus, StudentStatusAdmin)
|