From 64d112cc4f2d1b0afa77ff296bff6f609b94aaec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Chojnacki?= Date: Mon, 26 May 2025 20:13:03 +0200 Subject: [PATCH] Add explicit id field to avoid creating migration with DEFAULT_AUTO_FIELD set to BigAutoField (#142) Co-authored-by: blag --- dbtemplates/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbtemplates/models.py b/dbtemplates/models.py index a87ad4a..aa87dcb 100644 --- a/dbtemplates/models.py +++ b/dbtemplates/models.py @@ -18,6 +18,8 @@ class Template(models.Model): Defines a template model for use with the database template loader. The field ``name`` is the equivalent to the filename of a static template. """ + id = models.AutoField(primary_key=True, verbose_name=_('ID'), + serialize=False, auto_created=True) name = models.CharField(_('name'), max_length=100, help_text=_("Example: 'flatpages/default.html'")) content = models.TextField(_('content'), blank=True)