mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-11-08 21:21:06 +00:00
Add CustomIdEndpointLinkRowAction
This commit is contained in:
parent
43b54215d2
commit
e1d1ee2f84
1 changed files with 10 additions and 1 deletions
|
@ -14,6 +14,7 @@ from advlabdb.models import (
|
||||||
SemesterExperiment,
|
SemesterExperiment,
|
||||||
)
|
)
|
||||||
from advlabdb.utils import reportBadAttempt, userActiveSemester
|
from advlabdb.utils import reportBadAttempt, userActiveSemester
|
||||||
|
from flask_admin.model.template import EndpointLinkRowAction
|
||||||
|
|
||||||
|
|
||||||
def adminViewIsAccessible():
|
def adminViewIsAccessible():
|
||||||
|
@ -174,7 +175,7 @@ class SecureAssistantModelView(CustomModelView):
|
||||||
A default filter has to be implemented to restrict assistants read/write access.
|
A default filter has to be implemented to restrict assistants read/write access.
|
||||||
See on_model_change!
|
See on_model_change!
|
||||||
"""
|
"""
|
||||||
raise ModelViewException("Not implemented!")
|
raise NotImplementedError()
|
||||||
|
|
||||||
def on_model_change(self, form, model, is_created):
|
def on_model_change(self, form, model, is_created):
|
||||||
"""
|
"""
|
||||||
|
@ -204,3 +205,11 @@ class SecureAdminBaseView(BaseView):
|
||||||
class SecureAssistantBaseView(BaseView):
|
class SecureAssistantBaseView(BaseView):
|
||||||
def is_accessible(self):
|
def is_accessible(self):
|
||||||
return assistantViewIsAccessible()
|
return assistantViewIsAccessible()
|
||||||
|
|
||||||
|
|
||||||
|
class CustomIdEndpointLinkRowAction(EndpointLinkRowAction):
|
||||||
|
def customId(self, row):
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
def render(self, context, row_id, row):
|
||||||
|
return super().render(context, self.customId(row), row)
|
||||||
|
|
Loading…
Reference in a new issue