You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import pycountry
from django.db import models
# Creat the list of languages with ISO 639-1 alpha 2 only
LANGUAGE_CHOICES = [
(language.alpha_2, language.name) for language in pycountry.languages if hasattr(language, 'alpha_2')
]
class Document(models.Model):
title = models.CharField(max_length=200)
content = models.TextField()
language = models.CharField(
max_length=2,
choices=LANGUAGE_CHOICES,
default='en'
)
it may be usefull in international context, to display if the policy is writen in english or in a other language.
The text was updated successfully, but these errors were encountered: