class Category(models.Model):
name = models.CharField(max_length=100,null=True,blank=True)
def __str__(self):
class Items(models.Model):
name = models.CharField(max_length=100)
category = models.ForeignKey(Category,on_delete=models.CASCADE ,related_name='items')
def __str__(self):
I have data in category model,while creating items object i want to use data from category to add category to the item