mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 06:11:07 -05:00
major changes, including tailwind v4
This commit is contained in:
1752
docs/THRILLWIKI_PROJECT_DOCUMENTATION.md
Normal file
1752
docs/THRILLWIKI_PROJECT_DOCUMENTATION.md
Normal file
File diff suppressed because it is too large
Load Diff
73
docs/consolidation_analysis.md
Normal file
73
docs/consolidation_analysis.md
Normal file
@@ -0,0 +1,73 @@
|
||||
# Consolidation Analysis
|
||||
|
||||
## Review System Implementation
|
||||
|
||||
### Current Implementation
|
||||
- Uses Django's GenericForeignKey (confirmed)
|
||||
- Single Review model handles both parks and rides
|
||||
- Related models: ReviewImage, ReviewLike, ReviewReport
|
||||
- Content types: Currently supports any model type
|
||||
|
||||
### Migration Plan
|
||||
|
||||
1. **Create New Models**:
|
||||
```python
|
||||
# parks/models/reviews.py
|
||||
class ParkReview(TrackedModel):
|
||||
park = models.ForeignKey(Park, on_delete=models.CASCADE)
|
||||
# ... other review fields ...
|
||||
|
||||
# rides/models/reviews.py
|
||||
class RideReview(TrackedModel):
|
||||
ride = models.ForeignKey(Ride, on_delete=models.CASCADE)
|
||||
# ... other review fields ...
|
||||
```
|
||||
|
||||
2. **Data Migration Steps**:
|
||||
```python
|
||||
# Migration operations
|
||||
def migrate_reviews(apps, schema_editor):
|
||||
Review = apps.get_model('reviews', 'Review')
|
||||
ParkReview = apps.get_model('parks', 'ParkReview')
|
||||
RideReview = apps.get_model('rides', 'RideReview')
|
||||
|
||||
for review in Review.objects.all():
|
||||
if review.content_type.model == 'park':
|
||||
ParkReview.objects.create(
|
||||
park_id=review.object_id,
|
||||
# ... map other fields ...
|
||||
)
|
||||
elif review.content_type.model == 'ride':
|
||||
RideReview.objects.create(
|
||||
ride_id=review.object_id,
|
||||
# ... map other fields ...
|
||||
)
|
||||
```
|
||||
|
||||
3. **Update Related Models**:
|
||||
```python
|
||||
# Before (generic)
|
||||
class ReviewImage(models.Model):
|
||||
review = models.ForeignKey(Review, ...)
|
||||
|
||||
# After (concrete)
|
||||
class ParkReviewImage(models.Model):
|
||||
review = models.ForeignKey(ParkReview, ...)
|
||||
|
||||
class RideReviewImage(models.Model):
|
||||
review = models.ForeignKey(RideReview, ...)
|
||||
```
|
||||
|
||||
4. **Backward Compatibility**:
|
||||
- Maintain old Review API during transition period
|
||||
- Phase out generic reviews after data migration
|
||||
|
||||
### Entity Relationship Compliance
|
||||
- Park reviews will reference Park model (via Operator)
|
||||
- Ride reviews will reference Ride model (via Park → Operator)
|
||||
- Complies with entity relationship rules in .clinerules
|
||||
|
||||
### Risk Mitigation
|
||||
- Use data migration transactions
|
||||
- Create database backups before migration
|
||||
- Test with staging data first
|
||||
96
docs/search_integration_plan.md
Normal file
96
docs/search_integration_plan.md
Normal file
@@ -0,0 +1,96 @@
|
||||
# Search Integration Plan
|
||||
|
||||
## 1. File Structure
|
||||
```plaintext
|
||||
core/
|
||||
├── views/
|
||||
│ └── search.py # Search views implementation
|
||||
├── utils/
|
||||
│ └── search.py # Search utilities
|
||||
templates/
|
||||
└── core/
|
||||
└── search/ # Search templates
|
||||
├── results.html
|
||||
├── filters.html
|
||||
└── ...
|
||||
```
|
||||
|
||||
## 2. View Migration
|
||||
- Move `search/views.py` → `core/views/search.py`
|
||||
- Update view references:
|
||||
```python
|
||||
# Old: from search.views import AdaptiveSearchView
|
||||
# New:
|
||||
from core.views.search import AdaptiveSearchView, FilterFormView
|
||||
```
|
||||
|
||||
## 3. URL Configuration Updates
|
||||
Update `thrillwiki/urls.py`:
|
||||
```python
|
||||
# Before:
|
||||
path("search/", include("search.urls", namespace="search"))
|
||||
|
||||
# After:
|
||||
path("search/", include("core.urls.search", namespace="search"))
|
||||
```
|
||||
|
||||
Create `core/urls/search.py`:
|
||||
```python
|
||||
from django.urls import path
|
||||
from core.views.search import AdaptiveSearchView, FilterFormView
|
||||
from rides.views import RideSearchView
|
||||
|
||||
urlpatterns = [
|
||||
path('parks/', AdaptiveSearchView.as_view(), name='search'),
|
||||
path('parks/filters/', FilterFormView.as_view(), name='filter_form'),
|
||||
path('rides/', RideSearchView.as_view(), name='ride_search'),
|
||||
path('rides/results/', RideSearchView.as_view(), name='ride_search_results'),
|
||||
]
|
||||
```
|
||||
|
||||
## 4. Import Cleanup Strategy
|
||||
1. Update all imports:
|
||||
```python
|
||||
# Before:
|
||||
from search.views import ...
|
||||
from search.utils import ...
|
||||
|
||||
# After:
|
||||
from core.views.search import ...
|
||||
from core.utils.search import ...
|
||||
```
|
||||
|
||||
2. Remove old search app:
|
||||
```bash
|
||||
rm -rf search/
|
||||
```
|
||||
|
||||
3. Update `INSTALLED_APPS` in `thrillwiki/settings.py`:
|
||||
```python
|
||||
# Remove 'search' from INSTALLED_APPS
|
||||
INSTALLED_APPS = [
|
||||
# ...
|
||||
# 'search', # REMOVE THIS LINE
|
||||
# ...
|
||||
]
|
||||
```
|
||||
|
||||
## 5. Implementation Steps
|
||||
1. Create new directory structure in core
|
||||
2. Move view logic to `core/views/search.py`
|
||||
3. Create URL config in `core/urls/search.py`
|
||||
4. Move templates to `templates/core/search/`
|
||||
5. Update all import references
|
||||
6. Remove old search app
|
||||
7. Test all search functionality:
|
||||
- Park search filters
|
||||
- Ride search
|
||||
- HTMX filter updates
|
||||
8. Verify URL routes
|
||||
|
||||
## 6. Verification Checklist
|
||||
- [ ] All search endpoints respond with 200
|
||||
- [ ] Filter forms render correctly
|
||||
- [ ] HTMX updates work as expected
|
||||
- [ ] No references to old search app in codebase
|
||||
- [ ] Templates render with correct context
|
||||
Reference in New Issue
Block a user