Updated text and improved button contrast
This commit is contained in:
parent
e6e7fa328a
commit
b844947cfd
5 changed files with 29 additions and 35 deletions
|
@ -3,8 +3,7 @@ import uuid
|
|||
from django.db import models
|
||||
from django.forms import ModelForm
|
||||
from django.core.validators import FileExtensionValidator
|
||||
from django.utils.text import lazy
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
|
||||
class Category(models.Model):
|
||||
|
@ -15,7 +14,7 @@ class Category(models.Model):
|
|||
icon = models.CharField(max_length=64, default="folder", verbose_name=_("Icon"))
|
||||
|
||||
def __str__(self):
|
||||
return str(self.name)
|
||||
return self.name
|
||||
|
||||
class Meta:
|
||||
ordering = ["name"]
|
||||
|
@ -57,10 +56,7 @@ class Transaction(models.Model):
|
|||
)
|
||||
|
||||
def __str__(self):
|
||||
res = f"{self.date} {self.name}: {self.value}€"
|
||||
if self.category:
|
||||
return f"{res} ({self.category})"
|
||||
return res
|
||||
return f"{self.date} – {self.name}"
|
||||
|
||||
class Meta:
|
||||
ordering = ["-date"]
|
||||
|
@ -132,9 +128,7 @@ class Snapshot(models.Model):
|
|||
)
|
||||
|
||||
def __str__(self):
|
||||
if self.previous is None:
|
||||
return f"Snapshot {self.date}: {self.value}€"
|
||||
return f"Snapshot {self.date}: {self.value}€ (Previous: {self.previous.date})"
|
||||
return f"{_('Snapshot')} {self.date}"
|
||||
|
||||
def save(self, *args, only_super=False, **kwargs):
|
||||
if not only_super:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue