ExerciseType base
This commit is contained in:
parent
6b82bdbf59
commit
102f7ba703
@ -33,12 +33,15 @@ class TranslationInline(admin.TabularInline):
|
||||
|
||||
|
||||
class ExerciseTypeAdmin(admin.ModelAdmin):
|
||||
list_display = ('exercise_type_id', 'tree', 'name_colored', 'active')
|
||||
list_display = ('exercise_type_id', 'tree', 'name_colored', 'active', 'base')
|
||||
search_fields = ['name']
|
||||
|
||||
def name_colored(self, obj):
|
||||
if obj.active:
|
||||
color_code = '7bc863'
|
||||
if obj.base:
|
||||
color_code = '7bc863'
|
||||
else:
|
||||
color_code = '4178bc'
|
||||
else:
|
||||
color_code = 'C20000'
|
||||
html = '<span style="color: #{};">{}</span>˓→'.format(color_code, obj.name)
|
||||
|
@ -39,6 +39,7 @@ class ExerciseType(models.Model):
|
||||
unit_quantity_unit = models.CharField(choices=UnitTypes.choices, default=UnitTypes.KG, max_length=50, blank=True,
|
||||
null=True)
|
||||
active = models.BooleanField(default=0, blank=True, null=True)
|
||||
base = models.BooleanField(default=0, blank=True, null=True)
|
||||
|
||||
class Meta:
|
||||
db_table = 'exercise_type'
|
||||
|
Loading…
Reference in New Issue
Block a user