mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 06:51:08 -05:00
Add comprehensive API documentation for ThrillWiki integration and features
- Introduced Next.js integration guide for ThrillWiki API, detailing authentication, core domain APIs, data structures, and implementation patterns. - Documented the migration to Rich Choice Objects, highlighting changes for frontend developers and enhanced metadata availability. - Fixed the missing `get_by_slug` method in the Ride model, ensuring proper functionality of ride detail endpoints. - Created a test script to verify manufacturer syncing with ride models, ensuring data integrity across related models.
This commit is contained in:
@@ -8,7 +8,8 @@ from django.db.models import QuerySet, Q, Count, Avg, Prefetch
|
||||
from django.contrib.gis.geos import Point
|
||||
from django.contrib.gis.measure import Distance
|
||||
|
||||
from .models import Ride, RideModel, RideReview, CATEGORY_CHOICES
|
||||
from .models import Ride, RideModel, RideReview
|
||||
from .choices import RIDE_CATEGORIES
|
||||
|
||||
|
||||
def ride_list_for_display(
|
||||
@@ -275,10 +276,10 @@ def ride_statistics_by_category() -> Dict[str, Any]:
|
||||
"""
|
||||
|
||||
stats = {}
|
||||
for category_code, category_name in CATEGORY_CHOICES:
|
||||
if category_code: # Skip empty choice
|
||||
count = Ride.objects.filter(category=category_code).count()
|
||||
stats[category_code] = {"name": category_name, "count": count}
|
||||
for category in RIDE_CATEGORIES:
|
||||
if category.value: # Skip empty choice
|
||||
count = Ride.objects.filter(category=category.value).count()
|
||||
stats[category.value] = {"name": category.label, "count": count}
|
||||
|
||||
return stats
|
||||
|
||||
|
||||
Reference in New Issue
Block a user