Removed @models.permalink in favour of reverse(), which is the recommended way.