From 48d7dfe661a0eac4d7b85c0007bfcf76559facec Mon Sep 17 00:00:00 2001 From: Itai Shirav Date: Wed, 25 Jan 2017 14:39:41 +0200 Subject: [PATCH] Explain how table names are determined --- README.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.rst b/README.rst index f093d52..fc99ff8 100644 --- a/README.rst +++ b/README.rst @@ -34,6 +34,20 @@ It is possible to provide a default value for a field, instead of its "natural" See below for the supported field types and table engines. +Table Names +*********** + +The table name used for the model is its class name, converted to lowercase. To override the default name, +implement the ``table_name`` method:: + + class Person(models.Model): + + ... + + @classmethod + def table_name(cls): + return 'people' + Using Models ------------