WIP
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user