Files
org-social-relay/app/polls/__init__.py
Andros Fenollosa bf6797ba55 Add polls endpoints functionality
Implemented comprehensive polls API endpoints for Org Social Relay:

- GET /polls/ - List all active polls in the system
- GET /polls/?feed=<url> - Get polls for a specific feed
- GET /polls/?voter=<url> - Get votes cast by a specific voter
- GET /polls/votes/?feed=<url>&poll_id=<id> - Get votes for a specific poll

Features:
- Complete API endpoints with proper error handling
- Comprehensive test suite with 15 test cases
- Caching for improved performance
- Response format compliance with existing API patterns
- Support for filtering active vs expired polls
- Vote counting and aggregation
- Query parameter validation

Technical details:
- Created new Django app 'polls' in app/polls/
- Added polls app to Django settings and URL configuration
- Uses existing poll models from feeds app (PollOption, PollVote)
- Follows established patterns for API responses and error handling
- All tests passing with proper Given/When/Then structure
2025-09-21 11:52:25 +02:00

0 lines
0 B
Python