mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-30 23:27:04 -05:00
feat: Implement MFA authentication, add ride statistics model, and update various services, APIs, and tests across the application.
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
from django.db import models
|
||||
from django.conf import settings
|
||||
from django.core.validators import MinValueValidator, MaxValueValidator
|
||||
import pghistory
|
||||
from django.conf import settings
|
||||
from django.core.validators import MaxValueValidator, MinValueValidator
|
||||
from django.db import models
|
||||
|
||||
from apps.core.history import TrackedModel
|
||||
|
||||
|
||||
@pghistory.track()
|
||||
class RideCredit(TrackedModel):
|
||||
"""
|
||||
@@ -44,12 +45,15 @@ class RideCredit(TrackedModel):
|
||||
notes = models.TextField(
|
||||
blank=True, help_text="Personal notes about the experience"
|
||||
)
|
||||
display_order = models.PositiveIntegerField(
|
||||
default=0, help_text="User-defined display order for drag-drop sorting"
|
||||
)
|
||||
|
||||
class Meta(TrackedModel.Meta):
|
||||
verbose_name = "Ride Credit"
|
||||
verbose_name_plural = "Ride Credits"
|
||||
unique_together = ["user", "ride"]
|
||||
ordering = ["-last_ridden_at", "-first_ridden_at", "-created_at"]
|
||||
ordering = ["display_order", "-last_ridden_at", "-first_ridden_at", "-created_at"]
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.user} - {self.ride}"
|
||||
|
||||
Reference in New Issue
Block a user