+ if self.article_permalink_style in 'DMY':
+ article_patterns += patterns('',
+ url((r'^(?:%s)/(?P<year>\d{4})/?$' % self.article_permalink_base), self.article_archive_view)
+ )
+ if self.article_permalink_style in 'DM':
+ article_patterns += patterns('',
+ url((r'^(?:%s)/(?P<year>\d{4})/(?P<month>\d{2})/?$' % self.article_permalink_base), self.article_archive_view)
+ )
+ if self.article_permalink_style == 'D':
+ article_patterns += patterns('',
+ url((r'^(?:%s)/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/?$' % self.article_permalink_base), self.article_archive_view),
+ url((r'^(?:%s)/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[-\w]+)/?$' % self.article_permalink_base), self.article_view)
+ )
+ else:
+ article_patterns += patterns('',
+ url((r'^(?:%s)/(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[-\w]+)/?$' % self.article_permalink_base), self.article_view)
+ )
+ else:
+ article_patterns += patterns('',
+ url((r'^(?:%s)/(?P<year>\d{4})/(?P<slug>[-\w]+)/?$' % self.article_permalink_base), self.article_view)
+ )
+ else:
+ article_patterns += patterns('',
+ url((r'^(?:%s)/(?P<slug>[-\w]+)/?$' % self.article_permalink_base), self.article_view)
+ )
+ return base_patterns + article_patterns