diff --git a/.gitignore b/.gitignore index 6769e21..4293c41 100644 --- a/.gitignore +++ b/.gitignore @@ -157,4 +157,6 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ \ No newline at end of file +#.idea/ + +media/ \ No newline at end of file diff --git a/guild/migrations/0011_character_picture.py b/guild/migrations/0011_character_picture.py new file mode 100644 index 0000000..c94a8cf --- /dev/null +++ b/guild/migrations/0011_character_picture.py @@ -0,0 +1,19 @@ +# Generated by Django 4.2.1 on 2023-08-24 18:43 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("guild", "0010_playsessionsummaryversion"), + ] + + operations = [ + migrations.AddField( + model_name="character", + name="picture", + field=models.ImageField( + blank=True, null=True, upload_to="", verbose_name="Character Picture" + ), + ), + ] diff --git a/guild/models.py b/guild/models.py index 5e52c18..f448f2b 100644 --- a/guild/models.py +++ b/guild/models.py @@ -91,6 +91,10 @@ class Character(models.Model): blank=True, ) + picture = models.ImageField( + _("Character Picture"), null=True, blank=True, upload_to="uploads/" + ) + created_at = models.DateTimeField(_("created at"), auto_now_add=True) updated_at = models.DateTimeField(_("updated at"), auto_now=True) diff --git a/guild/templates/guild/character_detail.html b/guild/templates/guild/character_detail.html index 40471fb..c16cfe1 100644 --- a/guild/templates/guild/character_detail.html +++ b/guild/templates/guild/character_detail.html @@ -27,7 +27,17 @@ -
{{character.description|md|safe}}
+{{character.description|md|safe}}
+