Skip to content

Commit

Permalink
Added help text for category admin
Browse files Browse the repository at this point in the history
  • Loading branch information
dduan committed Aug 1, 2010
1 parent 6b44fbd commit 45a7496
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
3 changes: 2 additions & 1 deletion sophie/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ class CategoryAdmin(admin.ModelAdmin):
'title',
'slug',
'description',
('shown', 'entry_count',),
'shown',
'entry_count',
),
}),
)
Expand Down
40 changes: 28 additions & 12 deletions sophie/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,16 @@ class Blog(models.Model):
)
slug = models.SlugField(
unique=True,
help_text='''
Unique identifier of this blog,
only numbers, letters, "-" and "_" are allowed
'''
help_text='Unique identifier of this blog, '
'only numbers, letters, "-" and "_" are allowed'
)
page_length = models.PositiveIntegerField(
default = 5,
help_text = 'Number of entries displayed in each page.'
)
feed_length = models.PositiveIntegerField(
default = 15,
help_text = 'Number of entries contained in a feed.'
)
help_text = 'Number of entries contained in a feed.')
feed_service = models.CharField(
max_length = 200,
blank = True,
Expand Down Expand Up @@ -121,12 +118,31 @@ def get_blog(cls, slug=None):
return get_object_or_404(cls, slug=slug)

class Category(models.Model):
title = models.CharField(max_length = 200)
description = models.TextField(blank = True)
slug = models.SlugField(unique = True)
blog = models.ForeignKey(Blog)
entry_count = models.IntegerField(default = 0)
shown = models.BooleanField(default = True)
title = models.CharField(
max_length = 200,
help_text = 'Title of this category. No longer than 200 characters.'
)
description = models.TextField(
blank = True,
help_text = "Why this category?"
)
slug = models.SlugField(
unique = True,
help_text = 'Unique identifier of this category, '
'only numbers, letters, "-" and "_" are allowed'
)
blog = models.ForeignKey(
Blog,
help_text = 'Where does this category belong to?'
)
entry_count = models.IntegerField(
default = 0,
help_text = 'The number of entries catogerized under here.'
)
shown = models.BooleanField(
default = True,
help_text = 'Check me to make this category visible.'
)

objects = models.Manager()
visible = ShownCategoryManager()
Expand Down

0 comments on commit 45a7496

Please sign in to comment.