From 88dedfa6d375b5c8a9cafb195ddef52ca99a020d Mon Sep 17 00:00:00 2001 From: koksnuss Date: Fri, 24 Apr 2020 21:05:38 +0200 Subject: [PATCH] add model Stamp and solve the greece issue. add german and greek stamps --- coinmanager/coinc/admin.py | 7 ++++--- coinmanager/coinc/models.py | 20 +++++++++++++++++++- coinmanager/db.sqlite3 | Bin 163840 -> 180224 bytes 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/coinmanager/coinc/admin.py b/coinmanager/coinc/admin.py index 6ef8699..8afb371 100644 --- a/coinmanager/coinc/admin.py +++ b/coinmanager/coinc/admin.py @@ -20,9 +20,10 @@ from django.contrib import admin -from .models import User, Coin, Country +from .models import User, Coin, Country, Stamp -#admin.site.register(User) -#admin.site.register(Coin) +admin.site.register(User) +admin.site.register(Coin) admin.site.register(Country) +admin.site.register(Stamp) diff --git a/coinmanager/coinc/models.py b/coinmanager/coinc/models.py index 042cf30..e95631d 100644 --- a/coinmanager/coinc/models.py +++ b/coinmanager/coinc/models.py @@ -47,12 +47,30 @@ class Country(Model): euro_member_since = PositiveSmallIntegerField('Währungsmitglied seit', default=year_now) + stamps = ForeignKey('Stamp', on_delete=CASCADE, null=True, blank=True) + def __str__(self): return f"{self.name} - {self.name_iso}, Mitglied seit {self.euro_member_since}" +class Stamp(Model): + name_short = CharField('Prägung', max_length=10) + + name = CharField('Name', max_length=50) + + years = TextField('Im Einsatz in den Jahren ("" entspricht allen Jahren)', default='', blank=True) + + comment = TextField('Kommentar', default='', blank=True) + + + def __str__(self): + return f"{self.name_short} - {self.name} {self.comment}" + + + + class Coin(Model): value = PositiveSmallIntegerField('Wert', default=100) @@ -60,7 +78,7 @@ class Coin(Model): country = ForeignKey('Country', on_delete=CASCADE) - stamp = CharField('Prägerei', max_length=1, default='') + stamp = ForeignKey('Stamp', on_delete=CASCADE, null=True, blank=True) name = TextField('Name', default='', blank=True) diff --git a/coinmanager/db.sqlite3 b/coinmanager/db.sqlite3 index 36c23b6aab9df6eb16bed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