Add explicit id field to avoid creating migration with DEFAULT_AUTO_FIELD set to BigAutoField (#142)

Co-authored-by: blag <blag@users.noreply.github.com>
This commit is contained in:
Łukasz Chojnacki 2025-05-26 20:13:03 +02:00 committed by GitHub
parent 7f1c6701c1
commit 64d112cc4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)