add ids to workout for better lookup on the backend
This commit is contained in:
@@ -18,7 +18,7 @@ class SupersetInline(admin.StackedInline):
|
|||||||
@admin.register(Workout)
|
@admin.register(Workout)
|
||||||
class WorkoutAdmin(ImportExportModelAdmin):
|
class WorkoutAdmin(ImportExportModelAdmin):
|
||||||
search_fields = ['name', 'description', ]
|
search_fields = ['name', 'description', ]
|
||||||
list_display = ("name", "description", "estimated_time", "registered_user", "created_at", "updated_at")
|
list_display = ("id", "name", "description", "estimated_time", "registered_user", "created_at", "updated_at")
|
||||||
inlines = [
|
inlines = [
|
||||||
SupersetInline,
|
SupersetInline,
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class Workout(models.Model):
|
|||||||
estimated_time = models.FloatField(max_length=255, blank=True, null=True)
|
estimated_time = models.FloatField(max_length=255, blank=True, null=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name + " - " + self.description + " - by: " + str(self.registered_user.first_name) + " - on: " + str(self.created_at)
|
return str(self.id) + ": " + self.name + " - " + self.description + " - by: " + str(self.registered_user.first_name) + " - on: " + str(self.created_at)
|
||||||
|
|
||||||
class WorkoutExercise(models.Model):
|
class WorkoutExercise(models.Model):
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user