From 562773a081fd76d92ed76491e9ddcfab8357dccd Mon Sep 17 00:00:00 2001 From: Ole Laursen Date: Thu, 1 Mar 2012 13:07:47 +0000 Subject: [PATCH] Turn Group acronym into a SlugField, make the admin prepopulate the acronym - Legacy-Id: 4012 --- ietf/group/admin.py | 1 + ietf/group/models.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ietf/group/admin.py b/ietf/group/admin.py index fbb203650..2a1a12c3c 100644 --- a/ietf/group/admin.py +++ b/ietf/group/admin.py @@ -25,6 +25,7 @@ class GroupAdmin(admin.ModelAdmin): ordering = ["name"] raw_id_fields = ["charter", "parent", "ad"] inlines = [RoleInline] + prepopulated_fields = {"acronym": ("name", )} def role_list(self, obj): roles = Role.objects.filter(group=obj).order_by("name", "person__name").select_related('person') diff --git a/ietf/group/models.py b/ietf/group/models.py index 5a8fce5b5..723a74238 100644 --- a/ietf/group/models.py +++ b/ietf/group/models.py @@ -34,7 +34,7 @@ class GroupManager(models.Manager): class Group(GroupInfo): objects = GroupManager() - acronym = models.CharField(max_length=40, unique=True, db_index=True) + acronym = models.SlugField(max_length=40, unique=True, db_index=True) charter = models.OneToOneField('doc.Document', related_name='chartered_group', blank=True, null=True) def latest_event(self, *args, **filter_args):