Skip to content
Snippets Groups Projects
Commit 6552e7fc authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Add graphene type for LessonEvent

parent 89e7d348
No related branches found
No related tags found
1 merge request!301New data model based on calendar events
Pipeline #166262 failed
......@@ -3,6 +3,7 @@ from graphene_django import DjangoObjectType
from aleksis.core.models import Group, Person, Room
from ..models import LessonEvent
from ..util.chronos_helpers import get_classes, get_rooms, get_teachers
......@@ -45,6 +46,17 @@ class TimetableObjectType(graphene.ObjectType):
def resolve_id(root, info, **kwargs):
return f"{root.type.value}-{root.id}"
class LessonEventType(DjangoObjectType):
class Meta:
model = LessonEvent
fields = (
"id",
)
filter_fields = {
"id": ["exact", "lte", "gte"],
}
class Query(graphene.ObjectType):
......
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