exercise_type menu_id
This commit is contained in:
parent
35a3a9b0f9
commit
fc4a56e369
@ -2,6 +2,22 @@ from django.db import models
|
|||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
|
class ExerciseTree(models.Model):
|
||||||
|
item_id = models.AutoField(primary_key=True)
|
||||||
|
parent_id = models.IntegerField(help_text='This is the parent menu ID. 0 if it is on the top of the tree')
|
||||||
|
name = models.CharField(max_length=100, help_text='The name should be in English here')
|
||||||
|
image_url = models.ImageField(upload_to='images/', help_text='The menu image size is 1366x768')
|
||||||
|
active = models.BooleanField(default=0, blank=True, null=True)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
db_table = 'exercise_tree'
|
||||||
|
verbose_name = _("Exercise Tree")
|
||||||
|
verbose_name_plural = _("Exercise Tree Items")
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
class ExerciseType(models.Model):
|
class ExerciseType(models.Model):
|
||||||
class UnitTypes(models.TextChoices):
|
class UnitTypes(models.TextChoices):
|
||||||
REPEAT = 'repeat'
|
REPEAT = 'repeat'
|
||||||
@ -14,6 +30,7 @@ class ExerciseType(models.Model):
|
|||||||
KG = 'kilogram'
|
KG = 'kilogram'
|
||||||
|
|
||||||
exercise_type_id = models.AutoField(primary_key=True)
|
exercise_type_id = models.AutoField(primary_key=True)
|
||||||
|
tree = models.ForeignKey(ExerciseTree, on_delete=models.CASCADE)
|
||||||
name = models.CharField(max_length=100, help_text='The name should be in English here')
|
name = models.CharField(max_length=100, help_text='The name should be in English here')
|
||||||
description = models.TextField(max_length=1000, blank=True, null=True, help_text='The description should be in '
|
description = models.TextField(max_length=1000, blank=True, null=True, help_text='The description should be in '
|
||||||
'English here')
|
'English here')
|
||||||
@ -74,22 +91,6 @@ class ExerciseTypeTranslation(models.Model):
|
|||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
class ExerciseTree(models.Model):
|
|
||||||
item_id = models.AutoField(primary_key=True)
|
|
||||||
parent_id = models.IntegerField(help_text='This is the parent menu ID. 0 if it is on the top of the tree')
|
|
||||||
name = models.CharField(max_length=100, help_text='The name should be in English here')
|
|
||||||
image_url = models.ImageField(upload_to='images/', help_text='The menu image size is 1366x768')
|
|
||||||
active = models.BooleanField(default=0, blank=True, null=True)
|
|
||||||
|
|
||||||
class Meta:
|
|
||||||
db_table = 'exercise_tree'
|
|
||||||
verbose_name = _("Exercise Tree")
|
|
||||||
verbose_name_plural = _("Exercise Tree Items")
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return self.name
|
|
||||||
|
|
||||||
|
|
||||||
class ExerciseTreeTranslation(models.Model):
|
class ExerciseTreeTranslation(models.Model):
|
||||||
translation_id = models.AutoField(primary_key=True)
|
translation_id = models.AutoField(primary_key=True)
|
||||||
tree = models.ForeignKey(ExerciseTree, on_delete=models.CASCADE)
|
tree = models.ForeignKey(ExerciseTree, on_delete=models.CASCADE)
|
||||||
|
@ -74,7 +74,7 @@ WSGI_APPLICATION = 'aitrainer_backoffice.wsgi.application'
|
|||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.mysql',
|
'ENGINE': 'django.db.backends.mysql',
|
||||||
'NAME': 'aitrainer2',
|
'NAME': 'aitrainer',
|
||||||
'USER': 'aitrainer',
|
'USER': 'aitrainer',
|
||||||
'PASSWORD': 'andio2009',
|
'PASSWORD': 'andio2009',
|
||||||
'HOST': '127.0.0.1',
|
'HOST': '127.0.0.1',
|
||||||
|
Loading…
Reference in New Issue
Block a user