K
K
Kamral Magaramov2021-01-05 15:41:08
Python
Kamral Magaramov, 2021-01-05 15:41:08

How to fix Did not find any relation named "General_education_system_category_education" error?

5ff45e315d1e3623838642.png

#models


class General_education_system(models.Model):
    image = models.ImageField(upload_to='photo/')
    name = models.CharField(max_length=100)
    address = models.CharField(max_length=100)
    date_of_foundation = models.DateTimeField(auto_now_add=True, )
    filial = models.CharField(max_length=100, verbose_name='Филиал университета', blank=True)
    category=models.ForeignKey('Category_education',on_delete=models.CASCADE)
    history_of_university=models.TextField()


    def __str__(self):
        return self.name

class Category_education(models.Model):
    name=models.CharField(max_length=100,verbose_name='Общеобразовательная система')

    def get_absolute_url(self):
        return reverse('category', kwargs={'category_id'})

    def __str__(self):
        return self.name

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2021-01-05
@melkij

Because you don't have the General_education_system_category_education table. You have (presumably) "General_education_system_category_education"
https://www.postgresql.org/docs/current/sql-syntax...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question