From aa51e403a0edf828f7d1007c2108458525763ef6 Mon Sep 17 00:00:00 2001 From: boyska Date: Sat, 7 Mar 2020 19:22:25 +0100 Subject: [PATCH] admin page --- .../migrations/0003_auto_20200307_1922.py | 21 +++++++++++++++++++ rxmap/rxmapp/models.py | 9 +++++--- rxmap/rxmapp/templates/base.html | 7 ++++++- 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 rxmap/rxmapp/migrations/0003_auto_20200307_1922.py diff --git a/rxmap/rxmapp/migrations/0003_auto_20200307_1922.py b/rxmap/rxmapp/migrations/0003_auto_20200307_1922.py new file mode 100644 index 0000000..d1fbc61 --- /dev/null +++ b/rxmap/rxmapp/migrations/0003_auto_20200307_1922.py @@ -0,0 +1,21 @@ +# Generated by Django 2.2 on 2020-03-07 18:22 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('rxmapp', '0002_auto_20200307_1843'), + ] + + operations = [ + migrations.AlterModelOptions( + name='rapportoricezione', + options={'verbose_name': 'rapporto ricezione', 'verbose_name_plural': 'rapporti ricezione'}, + ), + migrations.AlterModelOptions( + name='tiporadio', + options={'verbose_name': 'tipo radio', 'verbose_name_plural': 'tipi radio'}, + ), + ] diff --git a/rxmap/rxmapp/models.py b/rxmap/rxmapp/models.py index b646a35..4bed29d 100644 --- a/rxmap/rxmapp/models.py +++ b/rxmap/rxmapp/models.py @@ -8,17 +8,20 @@ class User(AbstractUser): class TipoRadio(models.Model): - # tid = db.Column(db.Integer, primary_key=True, nullable=False) + class Meta: + verbose_name = 'tipo radio' + verbose_name_plural = 'tipi radio' nome = models.CharField(max_length=64, unique=True) descrizione = models.CharField(max_length=1000) - # rapporti = db.relationship("RapportoRicezione") + def __str__(self): + return self.nome class RapportoRicezione(models.Model): class Meta: verbose_name = "rapporto ricezione" - # verbose_plural_name = 'rapporti ricezione' + verbose_name_plural = 'rapporti ricezione' author = models.ForeignKey(User, related_name="rapporti", on_delete=models.PROTECT) tipo_radio = models.ForeignKey( diff --git a/rxmap/rxmapp/templates/base.html b/rxmap/rxmapp/templates/base.html index 1f9846f..d3e313e 100644 --- a/rxmap/rxmapp/templates/base.html +++ b/rxmap/rxmapp/templates/base.html @@ -64,7 +64,12 @@ footer { {% endblock extra_scripts %} {% endblock %}