0

I have successfully implemented models translation and i notice it is working like i can add content in multiple languages from the Django admin but when i implemented in django rest framework, it doesnt work for my expected language, I have successfully sent header for language, translatoin working fine except model translation.

I found this solution: Model translation in Django Rest Framework and I found it is good but not getting how to implement this.

This is my views

class BlogViewSets(ModelViewSet):
    serializer_class = BlogSerializer
    lookup_field = 'slug'


    def get_queryset(self):
        return BlogPage.objects.all()

Can anyone tell me please how can implement this advised solution? Model translation in Django Rest Framework

Not getting any way to implement this.

how recepes
  • 109
  • 2

1 Answers1

0

Try that:

def get_queryset(self):
    return BlogPage.objects.filter(id__isnull=False)
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 29 '23 at 06:24