Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Make the description for a plan a CharField

Roland Geider99182d4f8530
diff --git a/wger/nutrition/forms.py b/wger/nutrition/forms.py
index 11f4119a2..b546110f7 100644
--- a/wger/nutrition/forms.py
+++ b/wger/nutrition/forms.py
@@ -212,7 +212,8 @@ class MealItemForm(forms.ModelForm):
ingredient = forms.ModelChoiceField(queryset=Ingredient.objects.all(),
widget=forms.HiddenInput)
- ingredient_searchfield = forms.CharField(required=False)
+ ingredient_searchfield = forms.CharField(required=False,
+ label=ugettext_lazy("Ingredient"))
class Meta:
model = MealItem
diff --git a/wger/nutrition/migrations/0004_auto_20200819_2310.py b/wger/nutrition/migrations/0004_auto_20200819_2310.py
new file mode 100644
index 000000000..e86f648f5
--- /dev/null
+++ b/wger/nutrition/migrations/0004_auto_20200819_2310.py
@@ -0,0 +1,18 @@
+# Generated by Django 3.1 on 2020-08-19 21:10
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('nutrition', '0003_auto_20170118_2308'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='nutritionplan',
+ name='description',
+ field=models.CharField(blank=True, help_text='A description of the goal of the plan, e.g. "Gain mass" or "Prepare for summer"', max_length=80, verbose_name='Description'),
+ ),
+ ]
diff --git a/wger/nutrition/models.py b/wger/nutrition/models.py
index f4802b138..d156777be 100644
--- a/wger/nutrition/models.py
+++ b/wger/nutrition/models.py
@@ -87,7 +87,7 @@ class NutritionPlan(models.Model):
editable=False,
on_delete=models.CASCADE)
creation_date = models.DateField(_('Creation date'), auto_now_add=True)
- description = models.TextField(max_length=2000,
+ description = models.CharField(max_length=(80),
blank=True,
verbose_name=_('Description'),
help_text=_('A description of the goal of the plan, e.g. '