I would suggest you look at the object relational model section of the tutorial. And then browse the documentation for model references, relationships and lookups. Quite frankly, everything you're asking here is covered in detail there.
On Tuesday, June 26, 2018 at 8:27:22 AM UTC-4, Pravin Yadav wrote: > > Hello Everyone, > > > *I want to make INNER JOIN Query Or JOIN Query with "Video" and "* > *Thumbimages**". Kindly let me know.* > > *Below my Models:-* > > *from __future__ import unicode_literals* > *from django.db import models* > *from django.utils import timezone* > *from django.template.defaultfilters import slugify* > *from django.urls import reverse* > *from django.apps import apps* > *from django.contrib.auth.models import User* > > *# Create your models here.* > > *class Video(models.Model):* > > * STATUS_CHOICES = (* > * (1, 'Active'),* > * (0, 'Deactive'),* > * )* > * vid_cat_type = models.ForeignKey('category.Categorytype', > on_delete=models.CASCADE, null=True, blank=True)* > * vid_cat = models.ForeignKey('category.Category', > on_delete=models.CASCADE, null=True, blank=True)* > * user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, > blank=True)* > * videorand_id = models.BigIntegerField(null=True,blank=True)* > * video_name = models.FileField(upload_to='uploadvideo')* > * country = models.ForeignKey('countries.Countries', > on_delete=models.CASCADE, null=True, blank=True)* > * vid_title = models.CharField(max_length=255)* > * vid_description = models.TextField(null=True,blank=True)* > * status = models.IntegerField(choices=STATUS_CHOICES, default=1)* > * created_at = > models.DateTimeField(default=timezone.now,editable=True,blank=True,null=True)* > * updated_at = models.DateTimeField(auto_now=False,blank=True,null=True)* > > * def __str__(self):* > * return self.video_name* > > *class Thumbimages(models.Model):* > * THUMB_TYPE = (* > * (1, 'Active'),* > * (0, 'Deactive'),* > * )* > * video = models.ForeignKey(Video, on_delete=models.CASCADE, null=True, > blank=True)* > * thumb_image = > models.ImageField(upload_to='vidthumbimage',max_length=255,null=True,blank=True)* > * thumb_type = models.CharField(max_length=1,null=True,blank=True)* > * activateimg = models.IntegerField(choices=THUMB_TYPE, default=1)* > * created_at = > models.DateTimeField(default=timezone.now,editable=True,blank=True,null=True)* > * updated_at = models.DateTimeField(auto_now=False,blank=True,null=True)* > > > > *Thanks **In Advance,* > *Pravin Yadav* > > > > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2798abd0-7c71-4efc-b84d-53e71b5036b4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.