﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
9593	permalink breaks when using include() in urls.py	Ian Lewis	nobody	"If you use {{{include()}}} to include urls in another urls.py then include will fail to generate the proper urls for urls in the included urls.py if the urls fall in a sub-path.

In the given urls.py

{{{
...
urlpatterns = patterns('',
    (r'', include('core.urls')),
    (r'^blog/(.*)', include('blog.urls')),
)
...
}}}

and models.py
{{{
...
class Post(models.Model):
    """"""Post model.""""""
    title           = models.CharField(_('title'), max_length=200)
    slug            = models.SlugField(_('slug'), unique_for_date='publish')
    author          = models.ForeignKey(User, blank=True, null=True)
    body            = models.TextField(_('body'))
    publish         = models.DateTimeField(_('publish'))
    
    def __unicode__(self):
        return u'%s' % self.title

    @permalink
    def get_absolute_url(self):
        # return '/blog/%s/%s/%s/%s' % (self.publish.year,self.publish.strftime('%b').lower(),self.publish.day,self.slug)
        return ('blog_detail', None, {
            'year': self.publish.year,
            'month': self.publish.strftime('%b').lower(),
            'day': self.publish.day,
            'slug': self.slug
        })
...
}}}

using the {{{@permalink}}} decorator will work for core.urls but it would not work for blog.urls. The permalink decorator simply returns an empty string."		closed	Uncategorized	1.0		invalid			Unreviewed	0	0	0	0	0	0
