This commit is contained in:
Trey t
2023-06-12 21:50:13 -05:00
parent 7fdbaaa6f5
commit 3da41c3352
33 changed files with 223 additions and 75 deletions

View File

@@ -1,4 +1,5 @@
from django.db import models
from exercise.models import Exercise
# Create your models here.
class Equipment(models.Model):
@@ -9,4 +10,21 @@ class Equipment(models.Model):
name = models.CharField(null=True, blank=True, max_length=64)
def __str__(self):
return self.category + " : " + self.name
return self.category + " : " + self.name
class WorkoutEquipment(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
exercise = models.ForeignKey(
Exercise,
on_delete=models.CASCADE,
related_name='workout_exercise_workout'
)
equipment = models.ForeignKey(
Equipment,
on_delete=models.CASCADE,
related_name='workout_exercise_workout'
)
def __str__(self):
return self.exercise.name + " : " + self.equipment.name