Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 5.1 Support - deprecated index_together #567

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion schedule/models/calendars.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class CalendarRelation(models.Model):
class Meta:
verbose_name = _("calendar relation")
verbose_name_plural = _("calendar relations")
index_together = [("content_type", "object_id")]
indexes = [models.Index(fields=["content_type", "object_id"])]

def __str__(self):
return "{} - {}".format(self.calendar, self.content_object)
6 changes: 3 additions & 3 deletions schedule/models/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Event(models.Model):
class Meta:
verbose_name = _("event")
verbose_name_plural = _("events")
index_together = (("start", "end"),)
indexes = [models.Index(fields=["start", "end"])]

def __str__(self):
return gettext("%(title)s: %(start)s - %(end)s") % {
Expand Down Expand Up @@ -571,7 +571,7 @@ class EventRelation(models.Model):
class Meta:
verbose_name = _("event relation")
verbose_name_plural = _("event relations")
index_together = [("content_type", "object_id")]
indexes = [models.Index(fields=["content_type", "object_id"])]

def __str__(self):
return "{}({})-{}".format(
Expand All @@ -594,7 +594,7 @@ class Occurrence(models.Model):
class Meta:
verbose_name = _("occurrence")
verbose_name_plural = _("occurrences")
index_together = (("start", "end"),)
indexes = [models.Index(fields=["start", "end"])]

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down