Closed BigCheeze45 closed 1 week ago
As a manager, I need to know the names of Jan Doe's kids/pets because I'd like to specially recognize her service and I'd like to personalize it.
Reference the VolunteerActivity and VolunteerSkill models. Same idea except with pets & kids. Django model field reference
[x] VolunteerPet - links volunteer & all their pets
VolunteerPet
[x] VolunteerChildren - links volunteer & all their children
VolunteerChildren
After creating the models
app/models/__init__.py
make makemigrations
make migrate
Reference VolunteerSkillSerializer & VolunteerTeamSerializer & VolunteerActivitySerializer
VolunteerSerializer
A view is needed in order to create/read/update/delete kids & pets from volunteer. Again, reference similar view sets.
Finally update app/urls.py to make volunteer kids & pets accessible. E.g
app/urls.py
volunteer_router = routers.NestedSimpleRouter(router, r"volunteers", lookup="volunteer") volunteer_router.register(r"teams", VolunteerTeamViewSet, basename="volunteer-teams") volunteer_router.register(r"skills", VolunteerSkillViewSet, basename="volunteer-skills") volunteer_router.register( r"milestones", VolunteerMilestoneViewSet, basename="volunteer-milestones" ) volunteer_router.register( r"activities", VolunteerActivityViewSet, basename="volunteer-activities" )
SkillsList.tsx
VolunteerActivitiesList.tsx
As a manager, I need to know the names of Jan Doe's kids/pets because I'd like to specially recognize her service and I'd like to personalize it.
Backend
Models
Reference the VolunteerActivity and VolunteerSkill models. Same idea except with pets & kids. Django model field reference
[x]
VolunteerPet
- links volunteer & all their pets[x]
VolunteerChildren
- links volunteer & all their childrenAfter creating the models
app/models/__init__.py
make makemigrations
make migrate
Serializer
Reference VolunteerSkillSerializer & VolunteerTeamSerializer & VolunteerActivitySerializer
VolunteerSerializer
to include pets & children similar to how skills, teams and activities are included.View
A view is needed in order to create/read/update/delete kids & pets from volunteer. Again, reference similar view sets.
Routing
Finally update
app/urls.py
to make volunteer kids & pets accessible. E.gFrontend
SkillsList.tsx
&VolunteerActivitiesList.tsx