address
This commit is contained in:
parent
3a6e3a02d3
commit
451bd333aa
|
@ -0,0 +1,25 @@
|
||||||
|
# Generated by Django 4.2.1 on 2023-06-19 18:20
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
("guild", "0003_character_status"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterModelOptions(
|
||||||
|
name="playsession",
|
||||||
|
options={
|
||||||
|
"ordering": ["-date"],
|
||||||
|
"verbose_name": "playsession",
|
||||||
|
"verbose_name_plural": "playsessions",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name="player",
|
||||||
|
name="address",
|
||||||
|
field=models.TextField(blank=True, verbose_name="address"),
|
||||||
|
),
|
||||||
|
]
|
|
@ -6,6 +6,8 @@ from django.utils.translation import gettext as _
|
||||||
class Player(models.Model):
|
class Player(models.Model):
|
||||||
name = models.CharField(max_length=255, unique=True)
|
name = models.CharField(max_length=255, unique=True)
|
||||||
|
|
||||||
|
address = models.TextField(_("address"), blank=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _("player")
|
verbose_name = _("player")
|
||||||
verbose_name_plural = _("players")
|
verbose_name_plural = _("players")
|
||||||
|
|
|
@ -13,6 +13,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<h3>Address</h3>
|
||||||
|
<p>{{ player.address|linebreaks }}</p>
|
||||||
|
|
||||||
<h2>Characters</h2>
|
<h2>Characters</h2>
|
||||||
|
|
||||||
{% if not player.character_set.count %}
|
{% if not player.character_set.count %}
|
||||||
|
|
|
@ -7,7 +7,7 @@ from guild.models import Player
|
||||||
|
|
||||||
class CreatePlayerView(LoginRequiredMixin, CreateView):
|
class CreatePlayerView(LoginRequiredMixin, CreateView):
|
||||||
model = Player
|
model = Player
|
||||||
fields = ["name"]
|
fields = ["name", "address"]
|
||||||
|
|
||||||
|
|
||||||
class PlayerDetailView(LoginRequiredMixin, DetailView):
|
class PlayerDetailView(LoginRequiredMixin, DetailView):
|
||||||
|
@ -16,7 +16,7 @@ class PlayerDetailView(LoginRequiredMixin, DetailView):
|
||||||
|
|
||||||
class PlayerUpdateView(LoginRequiredMixin, UpdateView):
|
class PlayerUpdateView(LoginRequiredMixin, UpdateView):
|
||||||
model = Player
|
model = Player
|
||||||
fields = ["name"]
|
fields = ["name", "address"]
|
||||||
|
|
||||||
|
|
||||||
class PlayerDeleteView(LoginRequiredMixin, DeleteView):
|
class PlayerDeleteView(LoginRequiredMixin, DeleteView):
|
||||||
|
|
Loading…
Reference in New Issue