#31 API basic implementation

* adds new app to project
* adds relation between User model and new APIUserToken model
* adds first implementation for GET of intervention
* adds basic code layout for future extension by having new versions
This commit is contained in:
2022-01-21 15:26:08 +01:00
parent d8b503f2b5
commit 134651c8f7
20 changed files with 314 additions and 0 deletions

View File

@@ -15,6 +15,13 @@ from user.enums import UserNotificationEnum
class User(AbstractUser):
notifications = models.ManyToManyField("user.UserNotification", related_name="+", blank=True)
api_token = models.OneToOneField(
"api.APIUserToken",
blank=True,
null=True,
help_text="The user's API token",
on_delete=models.SET_NULL
)
def is_notification_setting_set(self, notification_enum: UserNotificationEnum):
return self.notifications.filter(