-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
How to set the plural text for a model? | ||
=========================================================== | ||
|
||
By default admin will show the name of your model appended with an "s", aka the plural form of your model. It looks like this | ||
|
||
.. image:: images/plural.png | ||
|
||
You have been asked to set the correct plural spellings: `Categories` and `Heroes` | ||
|
||
You can do this by setting the :code:`verbose_name_plural` in your models. Change that in your models.py.:: | ||
|
||
|
||
class Category(models.Model): | ||
... | ||
|
||
class Meta: | ||
verbose_name_plural = "Categories" | ||
|
||
|
||
class Hero(Entity): | ||
... | ||
|
||
class Meta: | ||
verbose_name_plural = "Heroes" | ||
|
||
|
||
.. image:: images/plural_fixed.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters