WIP
This commit is contained in:
41
superset/models.py
Normal file
41
superset/models.py
Normal file
@@ -0,0 +1,41 @@
|
||||
from django.db import models
|
||||
from workout.models import Workout
|
||||
from exercise.models import Exercise
|
||||
|
||||
# Create your models here.
|
||||
class Superset(models.Model):
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
name = models.CharField(max_length=255, blank=True, null=True)
|
||||
|
||||
workout = models.ForeignKey(
|
||||
Workout,
|
||||
on_delete=models.CASCADE
|
||||
)
|
||||
|
||||
rounds = models.IntegerField(max_length=3, blank=False, null=False)
|
||||
order = models.IntegerField(max_length=3, blank=False, null=False)
|
||||
|
||||
def __str__(self):
|
||||
return self.name #+ " : " + self.description + " | by: " + self.registered_user.nick_name
|
||||
|
||||
class SupersetExercise(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='superset_exercise_exercise'
|
||||
)
|
||||
|
||||
superset = models.ForeignKey(
|
||||
Superset,
|
||||
on_delete=models.CASCADE,
|
||||
related_name='superset_exercise_exercise'
|
||||
)
|
||||
|
||||
weight = models.IntegerField(null=True, blank=True, max_length=4)
|
||||
reps = models.IntegerField(null=True, blank=True, max_length=4)
|
||||
duration = models.IntegerField(null=True, blank=True, max_length=4)
|
||||
order = models.IntegerField(max_length=3, blank=False, null=False)
|
||||
Reference in New Issue
Block a user