Skip to content
Snippets Groups Projects
Commit 494615ab authored by permcu's avatar permcu
Browse files

Add ExtraMarkType to schema

parent 2c484afa
No related branches found
No related tags found
1 merge request!361Resolve "Add statistics page for absences"
from graphene_django.types import DjangoObjectType
from guardian.shortcuts import get_objects_for_user
from aleksis.core.schema.base import (
DjangoFilterMixin,
PermissionBatchPatchMixin,
PermissionsTypeMixin,
)
from ..models import ExtraMark
class ExtraMarkType(PermissionsTypeMixin, DjangoFilterMixin, DjangoObjectType):
class Meta:
model = ExtraMark
fields = ("id", "short_name", "name", "colour_fg", "colour_bg", "show_in_coursebook")
filter_fields = {
"short_name": ["icontains", "exact"],
"name": ["icontains", "exact"],
}
@classmethod
def get_queryset(cls, queryset, info):
return get_objects_for_user(info.context.user, "alsijil.view_extramark", queryset)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment