add model Stamp and solve the greece issue. add german and greek stamps
This commit is contained in:
parent
e77e0e3343
commit
88dedfa6d3
@ -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)
|
||||||
|
@ -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.
Loading…
x
Reference in New Issue
Block a user