admin page

This commit is contained in:
boyska 2020-03-07 19:22:25 +01:00
parent b94ae89e2a
commit aa51e403a0
3 changed files with 33 additions and 4 deletions

View file

@ -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'},
),
]

View file

@ -8,17 +8,20 @@ class User(AbstractUser):
class TipoRadio(models.Model): 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) nome = models.CharField(max_length=64, unique=True)
descrizione = models.CharField(max_length=1000) descrizione = models.CharField(max_length=1000)
# rapporti = db.relationship("RapportoRicezione") def __str__(self):
return self.nome
class RapportoRicezione(models.Model): class RapportoRicezione(models.Model):
class Meta: class Meta:
verbose_name = "rapporto ricezione" 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) author = models.ForeignKey(User, related_name="rapporti", on_delete=models.PROTECT)
tipo_radio = models.ForeignKey( tipo_radio = models.ForeignKey(

View file

@ -64,7 +64,12 @@ footer {
{% endblock extra_scripts %} {% endblock extra_scripts %}
{% endblock %} {% endblock %}
<footer> <footer>
<a href="https://git.lattuga.net/boyska/mappa-ricezione-radio">Talk is cheap</a> <span style="float:left;">
<a href="{% url 'admin:index' %}">Admin</a>
</span>
<span>
<a title="Show us the code" href="https://git.lattuga.net/boyska/mappa-ricezione-radio">Talk is cheap</a>
</span>
</footer> </footer>
</body> </body>
</html> </html>