mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 10:11:09 -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:
@@ -25,17 +25,21 @@ def get_ride_display_changes(changes: Dict) -> Dict:
|
||||
|
||||
# Format specific fields
|
||||
if field == "status":
|
||||
from .models import Ride
|
||||
|
||||
choices = dict(Ride.STATUS_CHOICES)
|
||||
old_value = choices.get(old_value, old_value)
|
||||
new_value = choices.get(new_value, new_value)
|
||||
from .choices import RIDE_STATUSES
|
||||
|
||||
choices = {choice.value: choice.label for choice in RIDE_STATUSES}
|
||||
if old_value in choices:
|
||||
old_value = choices[old_value]
|
||||
if new_value in choices:
|
||||
new_value = choices[new_value]
|
||||
elif field == "post_closing_status":
|
||||
from .models import Ride
|
||||
|
||||
choices = dict(Ride.POST_CLOSING_STATUS_CHOICES)
|
||||
old_value = choices.get(old_value, old_value)
|
||||
new_value = choices.get(new_value, new_value)
|
||||
from .choices import POST_CLOSING_STATUSES
|
||||
|
||||
choices = {choice.value: choice.label for choice in POST_CLOSING_STATUSES}
|
||||
if old_value in choices:
|
||||
old_value = choices[old_value]
|
||||
if new_value in choices:
|
||||
new_value = choices[new_value]
|
||||
|
||||
display_changes[field_names[field]] = {
|
||||
"old": old_value,
|
||||
@@ -61,11 +65,13 @@ def get_ride_model_display_changes(changes: Dict) -> Dict:
|
||||
|
||||
# Format category field
|
||||
if field == "category":
|
||||
from .models import CATEGORY_CHOICES
|
||||
from .choices import RIDE_CATEGORIES
|
||||
|
||||
choices = dict(CATEGORY_CHOICES)
|
||||
old_value = choices.get(old_value, old_value)
|
||||
new_value = choices.get(new_value, new_value)
|
||||
choices = {choice.value: choice.label for choice in RIDE_CATEGORIES}
|
||||
if old_value in choices:
|
||||
old_value = choices[old_value]
|
||||
if new_value in choices:
|
||||
new_value = choices[new_value]
|
||||
|
||||
display_changes[field_names[field]] = {
|
||||
"old": old_value,
|
||||
|
||||
Reference in New Issue
Block a user