Skip to content

Commit

Permalink
Pass linting
Browse files Browse the repository at this point in the history
  • Loading branch information
adamskrz committed May 17, 2024
1 parent 1d97a89 commit d584019
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ indent_size=2

[tool.ruff]
line-length = 120
exclude = ["schedule/management/commands/*"]

[tool.ruff.lint]
select = [
Expand Down
4 changes: 2 additions & 2 deletions schedule/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@


class ScheduleConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'schedule'
default_auto_field = "django.db.models.BigAutoField"
name = "schedule"
5 changes: 5 additions & 0 deletions schedule/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Organisation(models.Model):
description = models.TextField(blank=True, null=True)

def __str__(self):
"""Return the name of the organisation."""
return self.name


Expand All @@ -22,6 +23,7 @@ class Event(models.Model):
categories = models.ManyToManyField("Category", blank=True)

def __str__(self):
"""Return the key info about the event (name, title, organisation)."""
name_string = ""
if self.submission_id is not None:
name_string += f"{self.submission_id} - "
Expand All @@ -40,6 +42,7 @@ class EventInstance(models.Model):
parent = models.ForeignKey("self", on_delete=models.CASCADE, null=True, blank=True)

def __str__(self):
"""Return the key info about the event occurance (event, venue, start, end)."""
start_time = timezone.localtime(self.start).strftime("%A %H:%M")
end_time = timezone.localtime(self.end).strftime("%H:%M")
return f"{self.event} at {self.venue} from {start_time} to {end_time}"
Expand All @@ -50,6 +53,7 @@ class Venue(models.Model):
address = models.TextField()

def __str__(self):
"""Return the name of the venue."""
return self.name


Expand All @@ -61,4 +65,5 @@ class Meta:
verbose_name_plural = "categories"

def __str__(self):
"""Return the name of the category."""
return self.name

0 comments on commit d584019

Please sign in to comment.