- Add bloom_months to Plant and Species models (migration 0003)
- Swap pruning_months form field for bloom_months throughout
- Plant detail shows green bloom strip instead of pruning strip
- Dashboard shows 'Blooming now' count and list instead of overdue pruning
- Remove ✂️ pruning calendar from nav (feature hidden, backend intact)
- Update dashboard tests to reflect new context
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
16 lines
512 B
Python
16 lines
512 B
Python
from datetime import date
|
|
from django.shortcuts import render
|
|
from plants.models import Plant
|
|
|
|
|
|
def dashboard(request):
|
|
today = date.today()
|
|
all_plants = list(Plant.objects.select_related('species').all())
|
|
blooming_now = [p for p in all_plants if today.month in (p.bloom_months or [])]
|
|
|
|
return render(request, 'plants/dashboard.html', {
|
|
'total_plants': len(all_plants),
|
|
'blooming_now': blooming_now,
|
|
'blooming_now_count': len(blooming_now),
|
|
'today': today,
|
|
})
|