BO 1.7 Exercise Tree description
This commit is contained in:
parent
693893eee4
commit
a16de5c7cd
@ -26,7 +26,7 @@ from .models import ExercisePlanTemplate, ExercisePlanTemplateTranslation, Exerc
|
|||||||
|
|
||||||
class TranslationTreeInline(admin.TabularInline):
|
class TranslationTreeInline(admin.TabularInline):
|
||||||
model = ExerciseTreeTranslation
|
model = ExerciseTreeTranslation
|
||||||
fields = ('language_code', 'name',)
|
fields = ('language_code', 'name', 'description')
|
||||||
extra = 0
|
extra = 0
|
||||||
|
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ class ExerciseTreeAdmin(admin.ModelAdmin):
|
|||||||
list_display = ('tree_id', 'name_colored', 'active')
|
list_display = ('tree_id', 'name_colored', 'active')
|
||||||
search_fields = ['name']
|
search_fields = ['name']
|
||||||
|
|
||||||
fields = ["name", "image_url", "active", "get_image_preview"]
|
fields = ["name", 'description', "image_url", "active", "get_image_preview"]
|
||||||
readonly_fields = ("get_image_preview",)
|
readonly_fields = ("get_image_preview",)
|
||||||
|
|
||||||
def get_image_preview(self, obj):
|
def get_image_preview(self, obj):
|
||||||
|
@ -77,6 +77,8 @@ class ExerciseDeviceTranslation(models.Model):
|
|||||||
class ExerciseTree(models.Model):
|
class ExerciseTree(models.Model):
|
||||||
tree_id = models.AutoField(primary_key=True)
|
tree_id = models.AutoField(primary_key=True)
|
||||||
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 '
|
||||||
|
'English here')
|
||||||
image_url = models.ImageField(upload_to='images/', help_text='The menu image size is 1366x768')
|
image_url = models.ImageField(upload_to='images/', help_text='The menu image size is 1366x768')
|
||||||
active = models.BooleanField(default=0, blank=True, null=True)
|
active = models.BooleanField(default=0, blank=True, null=True)
|
||||||
|
|
||||||
@ -95,6 +97,7 @@ class ExerciseTreeTranslation(models.Model):
|
|||||||
tree = models.ForeignKey(ExerciseTree, on_delete=models.CASCADE)
|
tree = models.ForeignKey(ExerciseTree, on_delete=models.CASCADE)
|
||||||
language_code = models.CharField(max_length=2, choices=LanguageTypes.choices, default=LanguageTypes.HU)
|
language_code = models.CharField(max_length=2, choices=LanguageTypes.choices, default=LanguageTypes.HU)
|
||||||
name = models.CharField(max_length=100)
|
name = models.CharField(max_length=100)
|
||||||
|
description = models.TextField(max_length=1000, blank=True, null=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = 'exercise_tree_translation'
|
db_table = 'exercise_tree_translation'
|
||||||
|
@ -12,6 +12,8 @@ https://docs.djangoproject.com/en/3.0/ref/settings/
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
BACKOFFICE_VERSION = 1.7
|
||||||
|
|
||||||
# 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__)))
|
||||||
#BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
#BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
||||||
|
@ -12,6 +12,8 @@ https://docs.djangoproject.com/en/3.0/ref/settings/
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
BACKOFFICE_VERSION = 1.7
|
||||||
|
|
||||||
# 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