Browse files

Changed djangoproject.com Document.slug field to accept slashes

git-svn-id: http://code.djangoproject.com/svn/djangoproject.com@349 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 33d7731 commit e77bee804643a8fda2e392b848086222068ac435 adrian committed Jul 29, 2005
Showing with 8 additions and 8 deletions.
  1. +7 −7 django_website/apps/docs/models/docs.py
  2. +1 −1 django_website/apps/docs/urls/docs.py
View
14 django_website/apps/docs/models/docs.py
@@ -2,13 +2,13 @@
class Document(meta.Model):
fields = (
- meta.CharField('title', 'title', maxlength=200),
- meta.SlugField('slug', 'slug', unique=True, prepopulate_from=('title',)),
- meta.CharField('doc_path', 'doc path', maxlength=200,
+ meta.CharField('title', maxlength=200),
+ meta.CharField('slug', maxlength=50, unique=True, prepopulate_from=('title',)),
+ meta.CharField('doc_path', maxlength=200,
help_text="Relative to the docs directory in django SVN; leave off the file extension"),
meta.DateTimeField('last_updated', 'last updated', auto_now=True),
)
- ordering = (('title', 'ASC'),)
+ ordering = ('title',)
admin = meta.Admin(
fields = (
(None, {'fields': ('title', 'slug', 'doc_path')}),
@@ -18,10 +18,10 @@ class Document(meta.Model):
def __repr__(self):
return self.title
-
+
def get_absolute_url(self):
return "/documentation/%s/" % self.slug
-
+
def get_content(self):
try:
return self._doc_content
@@ -34,7 +34,7 @@ def get_content(self):
else:
self._doc_content = ''
return self._doc_content
-
+
def get_toc(self):
try:
return self._toc_content
View
2 django_website/apps/docs/urls/docs.py
@@ -8,5 +8,5 @@
}
urlpatterns = patterns('django.views.generic.list_detail',
- (r'^(?P<slug>\w+)', 'object_detail', info),
+ (r'^(?P<slug>[\w\/]+)/$', 'object_detail', info),
)

0 comments on commit e77bee8

Please sign in to comment.