Skip to content

Commit

Permalink
Améliore l'interface d'administration pour les objectifs
Browse files Browse the repository at this point in the history
* Ajoute l'auto-complétion du champ pour le slug à partir du nom de
  l'objectif
* Ajoute un lien pour accéder à la page listant les contenus ayant tel
  objectif
  • Loading branch information
philippemilink authored and Arnaud-D committed Jun 18, 2023
1 parent 878d523 commit 5d13328
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions zds/tutorialv2/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class ContentReviewTypeAdmin(admin.ModelAdmin):
class GoalAdmin(admin.ModelAdmin):
list_display = ["name", "description"]
ordering = ["position"]
prepopulated_fields = {"slug": ("name",)}


class LabelAdmin(admin.ModelAdmin):
Expand Down
4 changes: 4 additions & 0 deletions zds/tutorialv2/models/goals.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.core.validators import RegexValidator
from django.db import models
from django.urls import reverse
from django.utils.translation import gettext_lazy as _


Expand Down Expand Up @@ -30,3 +31,6 @@ class Meta:

def __str__(self):
return self.name

def get_absolute_url(self):
return reverse("content:view-goals") + "?" + self.slug

0 comments on commit 5d13328

Please sign in to comment.