Ditch pluralisation entirely

5 views
Skip to first unread message

Simon Willison

unread,
Nov 23, 2005, 7:03:27 AM11/23/05
to django-d...@googlegroups.com
Here's an easy lesson we can learn from Rails: pluralisation sucks.
Person -> People, Family -> Families etc is all very pretty but at
the end of the day you're constantly left asking yourself if the bug
you are facing would be fixed by adding or removing an S.

Under consideration at the moment is replacing magic modules in the
ORM with class methods.

entries.get_list()

becomes

Entry.get_list()

This would instantly eliminate the main usage of pluralisation in
Django.

The other one is database table names. I would argue that since these
are almost /never/ directly exposed in Django itself, they should be
left as singular as well (just the name of the model class casted to
lower case. If we wanted to be really radical we could leave them
Titlecased!). This is bound to upset a lot of DB style purists
(myself included) but the solution is there already: use the
db_table model parameter to override it.

Pluralisation is a nice idea in theory, but in practise it causes
more problems (in terms of confusion over whether something is
singular or plural) than it solves.

Cheers,

Simon

James Bennett

unread,
Nov 23, 2005, 7:08:08 AM11/23/05
to django-d...@googlegroups.com
On 11/23/05, Simon Willison <swil...@gmail.com> wrote:
> Pluralisation is a nice idea in theory, but in practise it causes
> more problems (in terms of confusion over whether something is
> singular or plural) than it solves.

Sounds good, though the verbose_name_plural and/or module_name
attributes still ought to be kept, I think; Django shouldn't make
assumptions about how to pluralize a model's name, but I should be
able to tell it how to do so if I desire.


--
"May the forces of evil become confused on the way to your house."
-- George Carlin

Maniac

unread,
Nov 23, 2005, 8:00:52 AM11/23/05
to django-d...@googlegroups.com
Simon Willison wrote:

> The other one is database table names. I would argue that since these
> are almost /never/ directly exposed in Django itself, they should be
> left as singular as well (just the name of the model class casted to
> lower case. If we wanted to be really radical we could leave them
> Titlecased!). This is bound to upset a lot of DB style purists
> (myself included) but the solution is there already: use the
> db_table model parameter to override it.

I'm in favor of depluralisation. This idea gives me an impression like I
always wanted it myself :-)

I'm not very deep into databases but I should say that in two jobs where
I worked with DBs more or less closely there were a strict rule to
always name tables in singular form. Of course what really matters is
the uniform convention that everyone should use. But singular form still
seems to me better since there can be no variations (like 'people' or
'children') and one can always use a model name as a table name.

hugo

unread,
Nov 23, 2005, 9:49:13 AM11/23/05
to Django developers
>Sounds good, though the verbose_name_plural and/or module_name
>attributes still ought to be kept, I think; Django shouldn't make
>assumptions about how to pluralize a model's name, but I should be
>able to tell it how to do so if I desire.

Actually I think that verbose_name_plural should go and instead of
that, an class method for proper pluralization should be added:

class Mystuff(meta.Model):
...
@classmethod
def pluralize(self, n):
return ngettext('singular', 'plural', n)

because otherwise we will allways have this problem with wrong
pluralizations in i18n projects. The current situation only works with
languages where you have singular and plural - but there are many
different concepts of pluralization.

Otherwise +1 on the 'remove simple-minded pluralization after removing
magic model modules'.

bye, Georg

Antonio Cavedoni

unread,
Nov 23, 2005, 9:54:41 AM11/23/05
to django-d...@googlegroups.com
On 23 Nov 2005, at 13:03, Simon Willison wrote:
> Here's an easy lesson we can learn from Rails: pluralisation sucks.
> Person -> People, Family -> Families etc is all very pretty but at
> the end of the day you're constantly left asking yourself if the
> bug you are facing would be fixed by adding or removing an S.

+1, let’s get rid of pluralisation altogether.

It’s also bad for newcomers: in my first django app I used to have
“newss” :-/

Cheers.
--
Antonio



James Bennett

unread,
Nov 23, 2005, 9:55:14 AM11/23/05
to django-d...@googlegroups.com
On 11/23/05, hugo <g...@hugo.westfalen.de> wrote:
> Actually I think that verbose_name_plural should go and instead of
> that, an class method for proper pluralization should be added:

Even better. That gets my vote.

Cheng Zhang

unread,
Nov 23, 2005, 11:27:23 AM11/23/05
to django-d...@googlegroups.com
Yes, to have S or not have bite me couple times during my short
period of learning Django. It looks cool but I agree that practically
it helps almost nothing. So here is my +1.

Eugene Lazutkin

unread,
Nov 23, 2005, 12:22:00 PM11/23/05
to django-d...@googlegroups.com
"Simon Willison" <swil...@gmail.com> wrote
in message news:61B3B8B0-6B08-45AE...@gmail.com...
>
> Pluralisation is a nice idea in theory, but in practise it causes more
> problems (in terms of confusion over whether something is singular or
> plural) than it solves.

+1



Nebojša Đorđević - nesh

unread,
Nov 24, 2005, 6:29:37 AM11/24/05
to django-d...@googlegroups.com
On 23-11-2005, at 15:49, hugo wrote:

> Actually I think that verbose_name_plural should go and instead of
> that, an class method for proper pluralization should be added:
>
> class Mystuff(meta.Model):
> ...
> @classmethod
> def pluralize(self, n):
> return ngettext('singular', 'plural', n)
>
> because otherwise we will allways have this problem with wrong
> pluralizations in i18n projects. The current situation only works with
> languages where you have singular and plural - but there are many
> different concepts of pluralization.

+1 great idea!

---
Nebojša Đorđević - nesh
Studio Quattro - Niš - SCG

http://djnesh.blogspot.com/ | http://djnesh-django.blogspot.com/
Registered Linux User 282159 [http://counter.li.org]



Ivan Fedorov

unread,
Nov 24, 2005, 12:34:53 PM11/24/05
to django-d...@googlegroups.com
Eugene Lazutkin пишет:
+1

Ian Holsman

unread,
Nov 24, 2005, 7:24:13 PM11/24/05
to django-d...@googlegroups.com
+1 if this is optional, and it just defaults to adding a 's'.


--
I...@Holsman.net -- ++61-3-9877-0909
If everything seems under control, you're not going fast enough. -
Mario Andretti

Reply all
Reply to author
Forward
0 new messages