Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
49260ce2
Commit
49260ce2
authored
2 years ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Create schema for Rooms
parent
ed6a225c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!1237
Release 3.0
,
!1202
Resolve "Supply Room ID and Name via Graphql"
,
!1183
Release 3.0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.rst
+5
-0
5 additions, 0 deletions
CHANGELOG.rst
aleksis/core/schema/__init__.py
+18
-1
18 additions, 1 deletion
aleksis/core/schema/__init__.py
aleksis/core/schema/room.py
+9
-0
9 additions, 0 deletions
aleksis/core/schema/room.py
with
32 additions
and
1 deletion
CHANGELOG.rst
+
5
−
0
View file @
49260ce2
...
...
@@ -9,6 +9,11 @@ and this project adheres to `Semantic Versioning`_.
Unreleased
----------
Added
~~~~~
* GraphQL schema for Rooms
Fixed
~~~~~
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/schema/__init__.py
+
18
−
1
View file @
49260ce2
...
...
@@ -9,7 +9,15 @@ from haystack.inputs import AutoQuery
from
haystack.query
import
SearchQuerySet
from
haystack.utils.loading
import
UnifiedIndex
from
..models
import
CustomMenu
,
DynamicRoute
,
Notification
,
PDFFile
,
Person
,
TaskUserAssignment
from
..models
import
(
CustomMenu
,
DynamicRoute
,
Notification
,
PDFFile
,
Person
,
Room
,
TaskUserAssignment
,
)
from
..util.apps
import
AppConfig
from
..util.core_helpers
import
get_allowed_object_ids
,
get_app_module
,
get_app_packages
,
has_person
from
.celery_progress
import
CeleryProgressFetchedMutation
,
CeleryProgressType
...
...
@@ -21,6 +29,7 @@ from .message import MessageType
from
.notification
import
MarkNotificationReadMutation
,
NotificationType
from
.pdf
import
PDFFileType
from
.person
import
PersonMutation
,
PersonType
from
.room
import
RoomType
from
.school_term
import
SchoolTermType
# noqa
from
.search
import
SearchResultType
from
.system_properties
import
SystemPropertiesType
...
...
@@ -59,6 +68,8 @@ class Query(graphene.ObjectType):
two_factor
=
graphene
.
Field
(
TwoFactorType
)
rooms
=
graphene
.
List
(
RoomType
)
def
resolve_ping
(
root
,
info
,
payload
)
->
str
:
return
payload
...
...
@@ -157,6 +168,12 @@ class Query(graphene.ObjectType):
return
None
return
info
.
context
.
user
@staticmethod
def
resolve_rooms
(
root
,
info
,
**
kwargs
):
if
info
.
context
.
user
.
is_anonymous
:
return
[]
return
Room
.
objects
.
all
()
class
Mutation
(
graphene
.
ObjectType
):
update_person
=
PersonMutation
.
Field
()
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/schema/room.py
0 → 100644
+
9
−
0
View file @
49260ce2
from
graphene_django
import
DjangoObjectType
from
..models
import
Room
class
RoomType
(
DjangoObjectType
):
class
Meta
:
model
=
Room
fields
=
(
"
id
"
,
"
name
"
,
"
short_name
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment