Skip to content

How to get a list of all Pages by language #289

Answered by kaedroho
carlosnasillo asked this question in Q&A
Discussion options

You must be logged in to vote

You can filter pages by their locale field. To get the current actively locale, use Locale.get_active()

For example:

current_locale_posts = BlogPost.objects.filter(locale=Locale.get_active())

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@carlosnasillo
Comment options

Answer selected by carlosnasillo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants