-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
770 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Pytest", | ||
"type": "python", | ||
"request": "test", | ||
"justMyCode": false, | ||
"presentation": { | ||
"hidden": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
from pathlib import Path | ||
|
||
import django_stubs_ext | ||
|
||
from .version import __version__ | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Package setup. | ||
# ------------------------------------------------------------------------------ | ||
|
||
BASE_DIR = Path(__file__).resolve().parent | ||
DATA_DIR = BASE_DIR.joinpath("data") | ||
|
||
django_stubs_ext.monkeypatch() | ||
|
||
from .version import __version__ | ||
# ------------------------------------------------------------------------------ | ||
|
||
from . import ( | ||
kurono, | ||
service, | ||
user, | ||
) | ||
# NOTE: These imports need to come after the package setup. | ||
# pylint: disable=wrong-import-position | ||
from . import kurono, service, user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[ | ||
{ | ||
"model": "user.Teacher", | ||
"pk": 1, | ||
"fields": { | ||
"last_saved_at": "2023-01-01 00:00:00.0+00:00", | ||
"is_admin": true | ||
} | ||
}, | ||
{ | ||
"model": "user.Teacher", | ||
"pk": 2, | ||
"fields": { | ||
"last_saved_at": "2023-01-01 00:00:00.0+00:00", | ||
"is_admin": true | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[ | ||
{ | ||
"model": "user.User", | ||
"pk": 1, | ||
"fields": { | ||
"last_saved_at": "2023-01-01 00:00:00.0+00:00", | ||
"first_name": "John", | ||
"last_name": "Doe", | ||
"username": "john.doe", | ||
"email": "[email protected]", | ||
"teacher": 1 | ||
} | ||
}, | ||
{ | ||
"model": "user.User", | ||
"pk": 2, | ||
"fields": { | ||
"last_saved_at": "2023-01-01 00:00:00.0+00:00", | ||
"first_name": "Jane", | ||
"last_name": "Doe", | ||
"username": "jane.doe", | ||
"email": "[email protected]", | ||
"teacher": 2 | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
""" | ||
© Ocado Group | ||
Created on 05/12/2023 at 17:46:22(+00:00). | ||
Class student join request model. | ||
""" | ||
|
||
from django.db import models | ||
|
||
from ...models import AbstractModel | ||
from . import klass as _class | ||
from . import student as _student | ||
|
||
|
||
# TODO: move to portal | ||
class ClassStudentJoinRequest(AbstractModel): | ||
"""A request from a student to join a class.""" | ||
|
||
klass: "_class.Class" = models.ForeignKey( | ||
"user.Class", | ||
related_name="student_join_requests", | ||
on_delete=models.CASCADE, | ||
) | ||
|
||
student: "_student.Student" = models.ForeignKey( | ||
"user.Student", | ||
related_name="class_join_requests", | ||
on_delete=models.CASCADE, | ||
) | ||
|
||
# created_at = models.DateTimeField( | ||
# _("created at"), | ||
# auto_now_add=True, | ||
# help_text=_("When the teacher was invited to the school."), | ||
# ) | ||
|
||
class Meta: | ||
unique_together = ["klass", "student"] | ||
# TODO: check student is independent | ||
# assert class is receiving requests | ||
# """ | ||
# © Ocado Group | ||
# Created on 05/12/2023 at 17:46:22(+00:00). | ||
|
||
# Class student join request model. | ||
# """ | ||
|
||
# from django.db import models | ||
|
||
# from ...models import AbstractModel | ||
# from . import klass as _class | ||
# from . import student as _student | ||
|
||
|
||
# # TODO: move to portal | ||
# class ClassStudentJoinRequest(AbstractModel): | ||
# """A request from a student to join a class.""" | ||
|
||
# klass: "_class.Class" = models.ForeignKey( | ||
# "user.Class", | ||
# related_name="student_join_requests", | ||
# on_delete=models.CASCADE, | ||
# ) | ||
|
||
# student: "_student.Student" = models.ForeignKey( | ||
# "user.Student", | ||
# related_name="class_join_requests", | ||
# on_delete=models.CASCADE, | ||
# ) | ||
|
||
# # created_at = models.DateTimeField( | ||
# # _("created at"), | ||
# # auto_now_add=True, | ||
# # help_text=_("When the teacher was invited to the school."), | ||
# # ) | ||
|
||
# class Meta: | ||
# unique_together = ["klass", "student"] | ||
# # TODO: check student is independent | ||
# # assert class is receiving requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.