Add explicit id field to avoid creating migration with DEFAULT_AUTO_FIELD set to BigAutoField

This commit is contained in:
Łukasz Chojnacki 2024-08-06 11:22:57 +02:00 committed by blag
parent ac740e06f3
commit 7082a99de0

View file

@ -19,6 +19,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)