Commit 364ae1c3 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Translate Role in CommitteeMembership

parent df0f0fe1
......@@ -25,7 +25,7 @@ class BoardAdmin(TranslatedModelAdmin):
@admin.register(models.CommitteeMembership)
class CommitteeMembershipAdmin(admin.ModelAdmin):
class CommitteeMembershipAdmin(TranslatedModelAdmin):
pass
......
......@@ -58,5 +58,16 @@ class Migration(migrations.Migration):
field=models.TextField(verbose_name='Description (NL)'),
preserve_default=True,
),
migrations.RenameField('committeemembership', 'role', 'role_nl'),
migrations.AddField(
model_name='committeemembership',
name='role_en',
field=models.CharField(blank=True, help_text='The role of this member', max_length=255, null=True, verbose_name='role (EN)'),
),
migrations.AlterField(
model_name='committeemembership',
name='role_nl',
field=models.CharField(blank=True, help_text='The role of this member', max_length=255, null=True, verbose_name='role (NL)'),
),
migrations.RunPython(forwards_func, reverse_func),
]
\ No newline at end of file
......@@ -114,7 +114,7 @@ class ActiveMembershipManager(models.Manager):
return super().get_queryset().exclude(until__lt=timezone.now().date())
class CommitteeMembership(models.Model):
class CommitteeMembership(models.Model, metaclass=ModelTranslateMeta):
objects = models.Manager()
active_memberships = ActiveMembershipManager()
......@@ -150,7 +150,8 @@ class CommitteeMembership(models.Model):
default=False,
)
role = models.CharField(
role = MultilingualField(
models.CharField,
_('role'),
help_text=_('The role of this member'),
max_length=255,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment