coalition.legal.admin ===================== .. py:module:: coalition.legal.admin Classes ------- .. autoapisummary:: coalition.legal.admin.LegalDocumentAdmin coalition.legal.admin.TermsAcceptanceAdmin Module Contents --------------- .. py:class:: LegalDocumentAdmin(model, admin_site) Bases: :py:obj:`django.contrib.admin.ModelAdmin` Encapsulate all admin options and functionality for a given model. .. py:attribute:: list_display :value: ['title', 'document_type', 'version', 'is_active', 'effective_date', 'created_at'] .. py:attribute:: list_filter :value: ['document_type', 'is_active', 'effective_date'] .. py:attribute:: search_fields :value: ['title', 'version', 'content'] .. py:attribute:: readonly_fields :value: ['created_at', 'updated_at'] .. py:attribute:: fieldsets .. py:method:: save_model(request: django.http.HttpRequest, obj: coalition.legal.models.LegalDocument, form: django.forms.ModelForm, change: bool) -> None Given a model instance save it to the database. .. py:class:: TermsAcceptanceAdmin(model, admin_site) Bases: :py:obj:`django.contrib.admin.ModelAdmin` Encapsulate all admin options and functionality for a given model. .. py:attribute:: list_display :value: ['endorsement_stakeholder', 'legal_document_title', 'document_version', 'accepted_at', 'ip_address'] .. py:attribute:: list_filter :value: ['accepted_at', 'legal_document__document_type'] .. py:attribute:: search_fields :value: ['endorsement__stakeholder__first_name', 'endorsement__stakeholder__last_name',... .. py:attribute:: readonly_fields :value: ['endorsement', 'legal_document', 'accepted_at', 'ip_address', 'user_agent'] .. py:method:: endorsement_stakeholder(obj: coalition.legal.models.TermsAcceptance) -> str .. py:method:: legal_document_title(obj: coalition.legal.models.TermsAcceptance) -> str .. py:method:: document_version(obj: coalition.legal.models.TermsAcceptance) -> str .. py:method:: has_add_permission(request: django.http.HttpRequest) -> bool Return True if the given request has permission to add an object. Can be overridden by the user in subclasses. .. py:method:: has_change_permission(request: django.http.HttpRequest, obj: coalition.legal.models.TermsAcceptance | None = None) -> bool Return True if the given request has permission to change the given Django model instance, the default implementation doesn't examine the `obj` parameter. Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to change the `obj` model instance. If `obj` is None, this should return True if the given request has permission to change *any* object of the given type. .. py:method:: has_delete_permission(request: django.http.HttpRequest, obj: coalition.legal.models.TermsAcceptance | None = None) -> bool Return True if the given request has permission to delete the given Django model instance, the default implementation doesn't examine the `obj` parameter. Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to delete the `obj` model instance. If `obj` is None, this should return True if the given request has permission to delete *any* object of the given type.