models - Django URL Slugs -
i have comment , post model. i want url come out /post//comment// but unsure how set up. my post model has this: @python_2_unicode_compatible class post(models.model): ... slug = models.slugfield(unique=true) @models.permalink def get_absolute_url(self): return 'appname:post', (self.slug,) can comment model have: @python_2_unicode_compatible class comment(models.model): ... slug = models.slugfield(unique=true) @models.permalink def get_absolute_url(self): return 'appname:post:comment', (self.slug,) or how hook get_absolute_url url comes out way mentioned? or there better way? @python_2_unicode_compatible class comment(models.model): title = models.charfield(max_length=100) body = models.charfield(max_length=1000) creation_date = models.datetimefield(auto_now_add=true) last_updated = models.datetimefield() author = models.foreignkey(person, related_name='authors')