Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Changed uuid to UUIDField

gmmoraesa8ee951762e0
diff --git a/wger/exercises/migrations/0004_auto_20170404_0114.py b/wger/exercises/migrations/0004_auto_20170404_0114.py
new file mode 100644
index 000000000..cecbc338a
--- /dev/null
+++ b/wger/exercises/migrations/0004_auto_20170404_0114.py
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.12 on 2017-04-04 01:14
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import uuid
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('exercises', '0003_auto_20160921_2000'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='exercise',
+ name='equipment',
+ field=models.ManyToManyField(blank=True, to='exercises.Equipment', verbose_name='Equipment'),
+ ),
+ migrations.AlterField(
+ model_name='exercise',
+ name='muscles',
+ field=models.ManyToManyField(blank=True, to='exercises.Muscle', verbose_name='Primary muscles'),
+ ),
+ migrations.AlterField(
+ model_name='exercise',
+ name='muscles_secondary',
+ field=models.ManyToManyField(blank=True, related_name='secondary_muscles', to='exercises.Muscle', verbose_name='Secondary muscles'),
+ ),
+ migrations.AlterField(
+ model_name='exercise',
+ name='status',
+ field=models.CharField(choices=[('1', 'Pending'), ('2', 'Accepted'), ('3', 'Declined')], default='1', editable=False, max_length=2),
+ ),
+ migrations.AlterField(
+ model_name='exercise',
+ name='uuid',
+ field=models.UUIDField(default=uuid.uuid4, editable=False, verbose_name='UUID'),
+ ),
+ migrations.AlterField(
+ model_name='exerciseimage',
+ name='is_main',
+ field=models.BooleanField(default=False, help_text='Tick the box if you want to set this image as the main one for the exercise (will be shown e.g. in the search). The first image is automatically marked by the system.', verbose_name='Main picture'),
+ ),
+ migrations.AlterField(
+ model_name='exerciseimage',
+ name='status',
+ field=models.CharField(choices=[('1', 'Pending'), ('2', 'Accepted'), ('3', 'Declined')], default='1', editable=False, max_length=2),
+ ),
+ ]
diff --git a/wger/exercises/models.py b/wger/exercises/models.py
index ae91e5707..958fe0357 100644
--- a/wger/exercises/models.py
+++ b/wger/exercises/models.py
@@ -205,11 +205,9 @@ class Exercise(AbstractSubmissionModel, AbstractLicenseModel, models.Model):
language = models.ForeignKey(Language,
verbose_name=_('Language'))
'''The exercise's language'''
-
- uuid = models.CharField(verbose_name='UUID',
- max_length=36,
- editable=False,
- default=uuid.uuid4)
+
+ uuid = models.UUIDField(default=uuid.uuid4, editable=False, verbose_name='UUID')
+
'''
Globally unique ID, to identify the exercise across installations
'''
@@ -272,7 +270,7 @@ class Exercise(AbstractSubmissionModel, AbstractLicenseModel, models.Model):
'''
Return a more human-readable representation
'''
- return self.name
+ return '%s %s' % (self.name)
#
# Own methods