init commit

This commit is contained in:
Trey t
2024-06-23 22:51:58 -05:00
commit ddf67a4fc5
315 changed files with 163458 additions and 0 deletions

30
equipment/models.py Normal file
View File

@@ -0,0 +1,30 @@
from django.db import models
from exercise.models import Exercise
# Create your models here.
class Equipment(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
is_weight = models.BooleanField(default=False)
category = models.CharField(null=True, blank=True, max_length=64)
name = models.CharField(null=True, blank=True, max_length=64)
def __str__(self):
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