user1121487
user1121487

Reputation: 2680

Django DB table names, plural double s

In Rails when creating DB tables from the models, Product becomes Products, Status becomes Statuses etc. Django does not fully seem to have that inbuilt grammar functionality. Product becomes Products, but Status becomes Statuss.

Is there a way to fix this?

Upvotes: 3

Views: 2383

Answers (1)

Aidan Ewen
Aidan Ewen

Reputation: 13328

Yes, there's an attributes you can add to a models class Meta, verbose_name_plural -

class YourModel(Model):
    # fields
    class Meta:
        verbose_name_plural = 'Statuses'

See the docs.

Upvotes: 9

Related Questions