Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nikolai Roede Dokken
tdt4242-SecFit
Commits
c0b00d16
Commit
c0b00d16
authored
Mar 10, 2022
by
Ian Evangelista
Browse files
started with the model
parent
954382ef
Pipeline
#160906
passed with stage
in 21 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
backend/secfit/challenges/__init__.py
0 → 100644
View file @
c0b00d16
backend/secfit/challenges/admin.py
0 → 100644
View file @
c0b00d16
from
django.contrib
import
admin
# Register your models here.
backend/secfit/challenges/apps.py
0 → 100644
View file @
c0b00d16
from
django.apps
import
AppConfig
class
ChallengesConfig
(
AppConfig
):
name
=
'challenges'
backend/secfit/challenges/migrations/__init__.py
0 → 100644
View file @
c0b00d16
backend/secfit/challenges/models.py
0 → 100644
View file @
c0b00d16
"""Contains the models for the challenges Django application. Coaches
can create challenges for a group of athletes or individuals.
"""
from
django.db
import
models
from
django.contrib.auth
import
get_user_model
from
backend.secfit.users.models
import
User
# Create your models here.
class
Challenge
(
models
.
Model
):
"""Django model for a challenge.
Attributes:
name: Name of the challenge
description: Notes about the meal
owner: User that logged the meal
"""
name
=
models
.
CharField
(
max_length
=
100
)
description
=
models
.
TextField
()
owner
=
models
.
ForeignKey
(
get_user_model
(),
on_delete
=
models
.
CASCADE
,
related_name
=
"meals"
)
# class ChallengeInstance(models.Model):
# """Django model for an instance of a challenge.
# Each challenge has one or multiple user
# Attributes:
# challenge: The challenge
# user: The user connected to the challenge
# """
# challenge = models.ForeignKey(
# Challenge, on_delete=models.CASCADE, related_name="users_instances"
# )
# user = models.ForeignKey(
# User, on_delete=models.CASCADE, related_name="instances"
# )
backend/secfit/challenges/tests.py
0 → 100644
View file @
c0b00d16
from
django.test
import
TestCase
# Create your tests here.
backend/secfit/challenges/views.py
0 → 100644
View file @
c0b00d16
from
django.shortcuts
import
render
# Create your views here.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment