I am new to the Django framework.
On Django's admin index page I'd like to get rid of the "s" at the end of my model names.
Exa开发者_JAVA百科mple:
<div class="module">
<table summary="Models available in the my application.">
<caption><a href="" class="section">My application</a></caption>
<tr>
<th scope="row"><a href="model/">Model**s**</a></th>
<td><a href="model/add/" class="addlink">Add</a></td>
<td><a href="model/" class="changelink">Change</a></td>
</tr>
</table>
</div>
I know of a way to do this but I am really looking for the file I should edit. Where is it and what exactly should I do?
I can't seem to pinpoint where it is coming from.
contrib/admin/templates/admin/index.html
- don't edit directly, just copy it to one of your own template directories in admin/
. You probably could just override the content block.
However
You probably just want to set verbose_name_plural
in your model's Meta class?
class Model(models.Model):
# fields
class Meta:
verbose_name_plural = 'Model'
精彩评论