Re: Admin Site appending letter "s" to end of each model\table name
On 09/10/2011 07:46 PM, gillwill2000@yahoo.com wrote:
It was only a problem insofar as I didn't like the way such a listing looked, particulalrly when I have several models that already, originally, have an "s" at the end of their name like "Movies", "Books", etc... which would then be listed as "Moviess", "Bookss"... and removing the "s" from their class names in models.py would require many code changes elsewhere in the app.Anyway, thanks to all for the solution:The verbose_name & verbose_name_plural did the trick.-Gil
It's conventional to name model in the singular by default, such as Movie and Book. You have a 'Movie' model, not a 'Movies' model. It also makes the default in the admin make perfect sense. If you have something that does end in is or the plural doesn't end in S (ox/oxen) then use verbose_name_plural.
If you think about it, a "Movies" doesn't have a "title" and "year_released" and a "rating" -- a "Movie" does.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home