Skip to content
Snippets Groups Projects
Commit c0b00d16 authored by Ian Evangelista's avatar Ian Evangelista
Browse files

started with the model

parent 954382ef
No related branches found
No related tags found
No related merge requests found
Pipeline #160906 passed
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class ChallengesConfig(AppConfig):
name = 'challenges'
"""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"
# )
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views here.
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