StudE-Backend/stude/student_status/admin.py

16 lines
496 B
Python
Raw Normal View History

2023-06-26 22:06:05 +08:00
from django.contrib import admin
from .models import StudentStatus
from leaflet.admin import LeafletGeoAdmin
2023-06-26 22:06:05 +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)