lifting app w/ basic models
This commit is contained in:
parent
ae7fc7daa9
commit
bd39151d95
0
lifting/__init__.py
Normal file
0
lifting/__init__.py
Normal file
3
lifting/admin.py
Normal file
3
lifting/admin.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.contrib import admin
|
||||||
|
|
||||||
|
# Register your models here.
|
31
lifting/migrations/0001_initial.py
Normal file
31
lifting/migrations/0001_initial.py
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import models, migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Exercise',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||||
|
('name', models.CharField(max_length=200)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
migrations.CreateModel(
|
||||||
|
name='Set',
|
||||||
|
fields=[
|
||||||
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||||
|
('date', models.DateField()),
|
||||||
|
('weight_kg', models.DecimalField(max_digits=7, decimal_places=3)),
|
||||||
|
('reps', models.PositiveIntegerField()),
|
||||||
|
('source', models.CharField(max_length=100)),
|
||||||
|
('exercise', models.ForeignKey(to='lifting.Exercise', related_name='sets')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]
|
0
lifting/migrations/__init__.py
Normal file
0
lifting/migrations/__init__.py
Normal file
18
lifting/models.py
Normal file
18
lifting/models.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
from django.db import models
|
||||||
|
|
||||||
|
SET_TYPES = (
|
||||||
|
('warmup', 'Warmup'),
|
||||||
|
('planned', 'Planned'),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class Exercise(models.Model):
|
||||||
|
name = models.CharField(max_length=200)
|
||||||
|
|
||||||
|
|
||||||
|
class Set(models.Model):
|
||||||
|
date = models.DateField()
|
||||||
|
exercise = models.ForeignKey(Exercise, related_name='sets')
|
||||||
|
weight_kg = models.DecimalField(max_digits=7, decimal_places=3)
|
||||||
|
reps = models.PositiveIntegerField()
|
||||||
|
source = models.CharField(max_length=100)
|
3
lifting/views.py
Normal file
3
lifting/views.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
# Create your views here.
|
Loading…
Reference in New Issue
Block a user