add model Stamp and solve the greece issue. add german and greek stamps

This commit is contained in:
koksnuss 2020-04-24 21:05:38 +02:00
parent e77e0e3343
commit 88dedfa6d3
3 changed files with 23 additions and 4 deletions

View File

@ -20,9 +20,10 @@
from django.contrib import admin 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(User)
#admin.site.register(Coin) admin.site.register(Coin)
admin.site.register(Country) admin.site.register(Country)
admin.site.register(Stamp)

View File

@ -47,12 +47,30 @@ class Country(Model):
euro_member_since = PositiveSmallIntegerField('Währungsmitglied seit', default=year_now) euro_member_since = PositiveSmallIntegerField('Währungsmitglied seit', default=year_now)
stamps = ForeignKey('Stamp', on_delete=CASCADE, null=True, blank=True)
def __str__(self): def __str__(self):
return f"{self.name} - {self.name_iso}, Mitglied seit {self.euro_member_since}" 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): class Coin(Model):
value = PositiveSmallIntegerField('Wert', default=100) value = PositiveSmallIntegerField('Wert', default=100)
@ -60,7 +78,7 @@ class Coin(Model):
country = ForeignKey('Country', on_delete=CASCADE) 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) name = TextField('Name', default='', blank=True)

Binary file not shown.