Менеджер недоступен через экземпляры модели

Я пытаюсь получить экземпляр объектов модели в другом. И я поднимаю эту ошибку:

 Manager isn't accessible via topic instance

Вот моя модель:

class forum(models.Model):
    # Some attributs

class topic(models.Model):
    # Some attributs

class post(models.Model):
    # Some attributs

    def delete(self):
        forum = self.topic.forum
        super(post, self).delete()
        forum.topic_count = topic.objects.filter(forum = forum).count()

Вот моя точка зрения:

def test(request, post_id):
    post = topic.objects.get(id = int(topic_id))
    post.delete()

И я получаю:

post.delete()
forum.topic_count = topic.objects.filter(forum = forum).count()
Manager isn't accessible via topic instances
70
задан tshepang 15 July 2014 в 20:16
поделиться