style(lint): apply ruff formatting rules with defined target-version

This commit is contained in:
Mike 2025-02-13 07:40:43 -08:00
parent 996512b04c
commit a95f2a1c33
3 changed files with 8 additions and 8 deletions

View file

@ -17,9 +17,9 @@ from .value import Value
__all__ = [
"Attribute",
"EAVModelMeta",
"Entity",
"EnumGroup",
"EnumValue",
"Value",
"Entity",
"EAVModelMeta",
]

View file

@ -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.

View file

@ -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