mirror of
https://github.com/jazzband/django-eav2.git
synced 2026-03-16 14:30:24 +00:00
style(lint): apply ruff formatting rules with defined target-version
This commit is contained in:
parent
996512b04c
commit
a95f2a1c33
3 changed files with 8 additions and 8 deletions
|
|
@ -17,9 +17,9 @@ from .value import Value
|
|||
|
||||
__all__ = [
|
||||
"Attribute",
|
||||
"EAVModelMeta",
|
||||
"Entity",
|
||||
"EnumGroup",
|
||||
"EnumValue",
|
||||
"Value",
|
||||
"Entity",
|
||||
"EAVModelMeta",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -178,16 +178,16 @@ class Value(models.Model):
|
|||
entity = self.entity_pk_uuid if self.entity_uuid else self.entity_pk_int
|
||||
return f'{self.attribute.name}: "{self.value}" ({entity})'
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
"""Validate and save this value."""
|
||||
self.full_clean()
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
"""Representation of Value object."""
|
||||
entity = self.entity_pk_uuid if self.entity_uuid else self.entity_pk_int
|
||||
return f'{self.attribute.name}: "{self.value}" ({entity})'
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
"""Validate and save this value."""
|
||||
self.full_clean()
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
def natural_key(self) -> tuple[tuple[str, str], int, str]:
|
||||
"""
|
||||
Retrieve the natural key for the Value instance.
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class Encounter(TestBase):
|
|||
patient = models.ForeignKey(Patient, on_delete=models.PROTECT)
|
||||
|
||||
def __str__(self):
|
||||
return "%s: encounter num %d" % (self.patient, self.num)
|
||||
return f"{self.patient}: encounter num {self.num}"
|
||||
|
||||
def __repr__(self):
|
||||
return self.name
|
||||
|
|
|
|||
Loading…
Reference in a new issue