def position(self):
        """ Returns an integer corresponding to the position of the post in the topic. """
        position = self.topic.posts.filter(Q(created__lt=self.created) | Q(id=self.id)).count()
        return position
def position ( self ) : position = self . topic . posts . filter ( Q ( created__lt = self . created ) | Q ( id = self . id ) ) . count ( ) return position
Returns an integer corresponding to the position of the post in the topic.