Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7526383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:48:49+00:00 2026-05-30T03:48:49+00:00

I have two models: class Video(models.Model): slug = models.SlugField(blank=True, default=”, db_index=True, unique=True) class VideoTranslation(models.Model):

  • 0

I have two models:

class Video(models.Model):
    slug = models.SlugField(blank=True, default='', db_index=True, unique=True)


class VideoTranslation(models.Model):
    video = models.ForeignKey(Video, related_name='translations')
    language = models.CharField(max_length=3, choices=settings.LANGUAGES)
    name = models.CharField(max_length=255, db_index=True)

Video contains some infromation about video, Video translation contains translated names of these videos.

I want to get itmes from Video model in one of languages.

It is possible by sql query like this:

SELECT * FROM video_video IN join video_videotranslation ON video_video.id = video_videotranslation.video_id where video_videotranslation.language="en" ORDER BY video_videotranslation.name;

but I really want to avoid raw sql queries.

Is it possible to make this kind of query rellying only on Django ORM?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T03:48:51+00:00Added an answer on May 30, 2026 at 3:48 am

    Absolutely, it will look like:

    Video.objects.filter(translations__language='en').order_by('translations__name')
    

    See lookups that span relationships for the syntax, and the documentation of order_by.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two models: class Actor(models.Model): name = models.CharField(max_length=30, unique = True) event =
I have two models like this: class OptionsAndFeatures(models.Model): options = models.TextField(blank=True, null=True) entertainment =
I have two models: class Studio(models.Model): name = models.CharField(Studio, max_length=30, unique=True) class Film(models.Model): studio
I have these two models : class Module(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(unique=True,
I have following two models class Questionnaire(models.model) name = models.CharField(max_length=128, null=True, blank=True) type =
I have two models: class Studio(models.Model): name = models.CharField(Studio, max_length=30, unique=True) class Film(models.Model): studio
I have two models with slug fields: class Book(models.Model): name = models.CharField(max_length=200) slug =
I have two models class Employer(models.Model): name = models.CharField(max_length=300, blank=False) id = models.IntegerField() status
I have two models for store and city: class City(models.Model): name = models.CharField() slug
In Django, I have two models: class Product(models.Model): name = models.CharField(max_length = 50) categories

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.