add comment field to Country, change wording of member_since to euro_member_since
This commit is contained in:
parent
ca1128fbd5
commit
6d8a75aad3
@ -23,6 +23,9 @@ from datetime import datetime
|
||||
from django.db.models import BooleanField, CASCADE, CharField, DateField, ForeignKey, Model, PositiveIntegerField, PositiveSmallIntegerField, TextField
|
||||
|
||||
|
||||
year_now = int(datetime.now().year)
|
||||
|
||||
|
||||
|
||||
class User(Model):
|
||||
name = CharField('Name', max_length=50, default='Anonym')
|
||||
@ -40,18 +43,19 @@ class Country(Model):
|
||||
|
||||
name = CharField('Land', max_length=50)
|
||||
|
||||
member_since = PositiveSmallIntegerField('Mitglied seit')
|
||||
comment = TextField('Kommentar', default='', blank=True)
|
||||
|
||||
euro_member_since = PositiveSmallIntegerField('Währungsmitglied seit', default=year_now)
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.name} - {self.name_iso}, Mitglied seit {self.member_since}"
|
||||
return f"{self.name} - {self.name_iso}, Mitglied seit {self.euro_member_since}"
|
||||
|
||||
|
||||
|
||||
class Coin(Model):
|
||||
value = PositiveSmallIntegerField('Wert', default=100)
|
||||
|
||||
year_now = int(datetime.now().year)
|
||||
year = PositiveSmallIntegerField('Jahr', default=year_now)
|
||||
|
||||
country = ForeignKey('Country', on_delete=CASCADE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user