Milano
Milano

Reputation: 18725

Django - field of language choices

I want to let users choose from languages they speak. Is there a Django built-in list of languages or should I get list of languages from another source?

For now:

class UserProfile(models.Model):
    languages = models.ManyToManyField(Language)

class Language(models.Model):
    shortcut ...
    name ... 

The languages field should only be able to list all languages user can speak.

Upvotes: 3

Views: 5442

Answers (2)

Brad Rhoads
Brad Rhoads

Reputation: 1846

There's the django-language-field. Unfortunately, it's sorted by the language code instead of the language name.

Upvotes: 3

Rodriguez David
Rodriguez David

Reputation: 571

Django doesn't have a build-in list of lenguages! You have to get your list of lenguages from other source! For example you might see: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

Upvotes: 0

Related Questions