1

can anyone tell me, how can I get rid of the postfix 's' from the db_table name. Below is the sample model code. When is see this model through the admin portal I see the database table name is 'countrys'. How can I remove this 's' from my db_table name?

class Country(models.Model):
    name = models.CharField(max_length=30)
    population = models.IntegerField()
    alpha2Code = models.CharField(max_length=2, primary_key=True)
    languages = models.CharField(max_length=256)

    class Meta:
        db_table = "country"

Thanks in advance

Andrew
  • 8,322
  • 2
  • 47
  • 70
  • Possible duplicate of https://stackoverflow.com/questions/2587707/django-fix-admin-plural – Vishwas Patel Sep 09 '21 at 17:04
  • Does this answer your question? [Django fix Admin plural](https://stackoverflow.com/questions/2587707/django-fix-admin-plural) – Andrew Sep 09 '21 at 20:51

1 Answers1

1

You need to set verbose_name_plural on Meta to 'countries'.

stefanw
  • 10,456
  • 3
  • 36
  • 34