user3278732
user3278732

Reputation: 1724

permalink error when calling get_absolute_url

def get_absolute_url(self):
        return ('threads_reply', [self.id])
    get_absolute_url = models.permalink(get_absolute_url)

I am migrating app from django 1.8 to django 2.2 and python 2.7 to python 3.6 I am getting error at that function, how can I change it correctly? I tried multiple ways it didnt work.

Upvotes: 1

Views: 26

Answers (1)

neverwalkaloner
neverwalkaloner

Reputation: 47374

You should use reverse() method:

def get_absolute_url(self):
        return reverse('threads_reply', args=[self.id])

Upvotes: 1

Related Questions