15.3.27. crate_anon.crateweb.core.admin¶
Copyright (C) 2015-2018 Rudolf Cardinal (rudolf@pobox.com).
This file is part of CRATE.
CRATE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
CRATE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with CRATE. If not, see <http://www.gnu.org/licenses/>.
-
class
crate_anon.crateweb.core.admin.
ConsentModeAdminForm
(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None)[source]¶
-
class
crate_anon.crateweb.core.admin.
ConsentModeMgrAdmin
(model, admin_site)[source]¶ -
form
¶ alias of
ConsentModeAdminForm
-
-
class
crate_anon.crateweb.core.admin.
ContactRequestResAdmin
(model, admin_site)[source]¶ -
get_queryset
(request: django.http.request.HttpRequest) → django.db.models.query.QuerySet[source]¶ Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
-
has_change_permission
(request: django.http.request.HttpRequest, obj: crate_anon.crateweb.consent.models.ContactRequest = None) → bool[source]¶ 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.
-
has_module_permission
(request: django.http.request.HttpRequest) → bool[source]¶ Return True if the given request has any permission in the given app label.
Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to view the module on the admin index page and access the module’s index page. Overriding it does not restrict access to the add, change or delete views. Use ModelAdmin.has_(add|change|delete)_permission for that.
-
-
class
crate_anon.crateweb.core.admin.
EmailMgrAdmin
(model, admin_site)[source]¶ Restrict to e-mails/information visible to the RDBM. Also, since we’re not inhering from AllStaffReadOnlyModelAdmin, give admin read permissions to all staff.
-
class
crate_anon.crateweb.core.admin.
EmailResAdmin
(model, admin_site)[source]¶ Restrict to e-mails visible to a researcher. Also, since we’re not inhering from AllStaffReadOnlyModelAdmin, give admin read permissions to all staff.
-
get_queryset
(request: django.http.request.HttpRequest) → django.db.models.query.QuerySet[source]¶ Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
-
has_change_permission
(request: django.http.request.HttpRequest, obj: crate_anon.crateweb.consent.models.Email = None) → bool[source]¶ 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.
-
has_module_permission
(request: django.http.request.HttpRequest) → bool[source]¶ Return True if the given request has any permission in the given app label.
Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to view the module on the admin index page and access the module’s index page. Overriding it does not restrict access to the add, change or delete views. Use ModelAdmin.has_(add|change|delete)_permission for that.
-
-
class
crate_anon.crateweb.core.admin.
LetterMgrAdmin
(model, admin_site)[source]¶ Restrict to letters visible to a researcher.
-
class
crate_anon.crateweb.core.admin.
LetterResAdmin
(model, admin_site)[source]¶ -
get_queryset
(request: django.http.request.HttpRequest) → django.db.models.query.QuerySet[source]¶ Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
-
has_change_permission
(request: django.http.request.HttpRequest, obj: crate_anon.crateweb.consent.models.Letter = None) → bool[source]¶ 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.
-
has_module_permission
(request: django.http.request.HttpRequest) → bool[source]¶ Return True if the given request has any permission in the given app label.
Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to view the module on the admin index page and access the module’s index page. Overriding it does not restrict access to the add, change or delete views. Use ModelAdmin.has_(add|change|delete)_permission for that.
-
readonly_fields
= ('id', 'created_at', 'get_pdf', 'to_clinician', 'to_researcher', 'to_patient', 'study', 'contact_request', 'sent_manually_at', 'email')¶ Restrict to letters visible to a researcher.
-
-
class
crate_anon.crateweb.core.admin.
PatientResponseAdminForm
(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None)[source]¶
-
class
crate_anon.crateweb.core.admin.
PatientResponseMgrAdmin
(model, admin_site)[source]¶ -
form
¶ alias of
PatientResponseAdminForm
-
get_queryset
(request: django.http.request.HttpRequest) → django.db.models.query.QuerySet[source]¶ Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
-
has_change_permission
(request: django.http.request.HttpRequest, obj: crate_anon.crateweb.consent.models.PatientResponse = None) → bool[source]¶ 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.
-