BO 1.37 next_training_plan
This commit is contained in:
parent
81e77e22c2
commit
2a2844415d
@ -100,7 +100,7 @@ class TranslationTrainingPlanInline(admin.TabularInline):
|
|||||||
|
|
||||||
class TrainingPlanAdmin( admin.ModelAdmin):
|
class TrainingPlanAdmin( admin.ModelAdmin):
|
||||||
list_display = ('training_plan_id', 'name', 'internal_name', 'free', 'active')
|
list_display = ('training_plan_id', 'name', 'internal_name', 'free', 'active')
|
||||||
fields = ('tree','training_program', 'name', 'description', 'internal_name', 'free', 'active', 'weeks')
|
fields = ('tree','training_program', 'name', 'description', 'internal_name', 'free', 'active', 'weeks', 'next_training_plan')
|
||||||
list_editable = ('name', 'internal_name', 'free', 'active')
|
list_editable = ('name', 'internal_name', 'free', 'active')
|
||||||
|
|
||||||
def save_model(self, request, obj, form, change):
|
def save_model(self, request, obj, form, change):
|
||||||
@ -142,8 +142,8 @@ class TrainingPlanAdmin( admin.ModelAdmin):
|
|||||||
|
|
||||||
class TrainingPlanDetailAdmin(SortableAdminMixin, admin.ModelAdmin):
|
class TrainingPlanDetailAdmin(SortableAdminMixin, admin.ModelAdmin):
|
||||||
list_display = (
|
list_display = (
|
||||||
'sort', 'training_plan', 'exercise_type', 'set', 'repeats', 'max', 'weight', 'calc',
|
'sort', 'training_plan', 'exercise_type', 'set', 'repeats', 'weight', 'max','calc',
|
||||||
'resting_time', 'parallel', 'day')
|
'resting_time', 'parallel', 'day', 'ecto_repeats', 'ecto_weight', 'endo_repeats', 'endo_weight', 'round', 'round_group')
|
||||||
list_filter = ('training_plan__name', 'exercise_type__name')
|
list_filter = ('training_plan__name', 'exercise_type__name')
|
||||||
list_editable = (
|
list_editable = (
|
||||||
'exercise_type', 'set', 'repeats', 'weight', 'resting_time', 'parallel', 'day')
|
'exercise_type', 'set', 'repeats', 'weight', 'resting_time', 'parallel', 'day')
|
||||||
|
@ -8,18 +8,30 @@ from ..models.training_plan_day import TrainingPlanDay
|
|||||||
from ..models.training_program import TrainingProgram
|
from ..models.training_program import TrainingProgram
|
||||||
|
|
||||||
|
|
||||||
|
class TrainingPlanNext(models.Model):
|
||||||
|
training_plan_id = models.AutoField(primary_key=True)
|
||||||
|
name = models.CharField(max_length=100, help_text='The name of the training plan',
|
||||||
|
verbose_name=_("name"))
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
db_table = 'training_plan'
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
class TrainingPlan(models.Model):
|
class TrainingPlan(models.Model):
|
||||||
training_plan_id = models.AutoField(primary_key=True)
|
training_plan_id = models.AutoField(primary_key=True)
|
||||||
tree = models.ForeignKey(ExerciseTree,on_delete=models.CASCADE, limit_choices_to={'active':True})
|
tree = models.ForeignKey(ExerciseTree,on_delete=models.CASCADE, limit_choices_to={'active':True})
|
||||||
training_program = models.ForeignKey(TrainingProgram, on_delete=models.CASCADE, blank=True,null=True)
|
training_program = models.ForeignKey(TrainingProgram, on_delete=models.CASCADE, blank=True,null=True)
|
||||||
name = models.CharField(max_length=100, help_text='The name of the training plan',
|
name = models.CharField(max_length=100, help_text='The name of the training plan', verbose_name=_("name"))
|
||||||
verbose_name=_("name"))
|
|
||||||
description = RichTextField(blank=True, null=True)
|
description = RichTextField(blank=True, null=True)
|
||||||
internal_name = models.CharField(max_length=50, blank=True, help_text='Only for programmers! "internal_name" format',
|
internal_name = models.CharField(max_length=50, blank=True, help_text='Only for programmers! "internal_name" format',
|
||||||
verbose_name=_("internal_name"))
|
verbose_name=_("internal_name"))
|
||||||
free = models.BooleanField(blank=True)
|
free = models.BooleanField(blank=True)
|
||||||
active = models.BooleanField()
|
active = models.BooleanField()
|
||||||
weeks = models.IntegerField(blank=True, null=True )
|
weeks = models.IntegerField(blank=True, null=True)
|
||||||
|
next_training_plan = models.ForeignKey(TrainingPlanNext, on_delete=models.CASCADE, blank=True, null=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = 'training_plan'
|
db_table = 'training_plan'
|
||||||
@ -28,8 +40,8 @@ class TrainingPlan(models.Model):
|
|||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
class TrainingPlanDetail(models.Model):
|
class TrainingPlanDetail(models.Model):
|
||||||
training_plan_detail_id = models.AutoField(primary_key=True)
|
training_plan_detail_id = models.AutoField(primary_key=True)
|
||||||
training_plan = models.ForeignKey(TrainingPlan, on_delete=models.CASCADE)
|
training_plan = models.ForeignKey(TrainingPlan, on_delete=models.CASCADE)
|
||||||
@ -41,6 +53,12 @@ class TrainingPlanDetail(models.Model):
|
|||||||
resting_time = models.IntegerField(blank=True)
|
resting_time = models.IntegerField(blank=True)
|
||||||
parallel = models.BooleanField(blank=True)
|
parallel = models.BooleanField(blank=True)
|
||||||
day = models.ForeignKey(TrainingPlanDay, on_delete=models.CASCADE, blank=True,null=True)
|
day = models.ForeignKey(TrainingPlanDay, on_delete=models.CASCADE, blank=True,null=True)
|
||||||
|
ecto_repeats = models.IntegerField(blank=True)
|
||||||
|
ecto_weight = models.IntegerField(blank=True)
|
||||||
|
endo_repeats = models.IntegerField(blank=True)
|
||||||
|
endo_weight = models.IntegerField(blank=True)
|
||||||
|
round = models.IntegerField(blank=True)
|
||||||
|
round_group = models.CharField(max_length=2, default=LanguageTypes.HU)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = 'training_plan_detail'
|
db_table = 'training_plan_detail'
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
from firebase_admin import initialize_app
|
from firebase_admin import initialize_app
|
||||||
|
|
||||||
BACKOFFICE_VERSION = "1.36"
|
BACKOFFICE_VERSION = "1.37"
|
||||||
|
|
||||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
from firebase_admin import initialize_app
|
from firebase_admin import initialize_app
|
||||||
|
|
||||||
BACKOFFICE_VERSION = "1.36"
|
BACKOFFICE_VERSION = "1.37"
|
||||||
|
|
||||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
from firebase_admin import initialize_app
|
from firebase_admin import initialize_app
|
||||||
|
|
||||||
BACKOFFICE_VERSION = "1.36"
|
BACKOFFICE_VERSION = "1.37"
|
||||||
|
|
||||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
Loading…
Reference in New Issue
Block a user