I am new to django and have a bit of a problem. I was creating a simple view, template and models for small project. I was getting error that Vote_Type does not exist, when I was asking for Type model in 'Vote' app. I don't get why is it looking for Vote_Type instead of Type in database.
So I went to look for a problem and now that I tried to create a object of model Type in database from python console I got the same error.
This is my models:
from django.db import models
from django.utils import timezone
# Create your models here.
class Voted_Object(models.Model):
Voted_Object_name = models.CharField(max_length=50)
Voted_Object_image = models.ImageField
Voted_Object_rating = models.IntegerField(default=0)
Voted_Object_Id = models.IntegerField
class Type(models.Model):
pub_date = models.DateTimeField('date published')
Type_name = models.CharField(max_length=50)
Type_Id = models.IntegerField
and this is the error I get when I try to do Type.objects.all() in python console.
relation "Vote_type" does not exist LINE 1: ...te_type"."pub_date", "Vote_type"."Type_name" FROM "Vote_type..
What is wrong with my code? why is django looking for Vote_Type instead of Type
makemigrationsandmigrate?