some more urls
This commit is contained in:
parent
9628826781
commit
50727688af
2 changed files with 23 additions and 1 deletions
12
fbf/urls.py
12
fbf/urls.py
|
@ -1,9 +1,19 @@
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
|
|
||||||
from .views import bird_create, bird_all, bird_single
|
from .views import (
|
||||||
|
bird_create,
|
||||||
|
bird_all,
|
||||||
|
bird_single,
|
||||||
|
bird_delete,
|
||||||
|
bird_recover,
|
||||||
|
bird_recover_all,
|
||||||
|
)
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("create/", bird_create, name="bird_create"),
|
path("create/", bird_create, name="bird_create"),
|
||||||
|
path("delete/<id>", bird_delete, name="bird_delete"),
|
||||||
|
path("recover/all", bird_recover_all, name="bird_recover_all"),
|
||||||
|
path("recover/<id>", bird_recover, name="bird_recover"),
|
||||||
path("all/", bird_all, name="bird_all"),
|
path("all/", bird_all, name="bird_all"),
|
||||||
path("<id>/", bird_single, name="bird_single"),
|
path("<id>/", bird_single, name="bird_single"),
|
||||||
]
|
]
|
||||||
|
|
12
fbf/views.py
12
fbf/views.py
|
@ -9,5 +9,17 @@ def bird_all(request):
|
||||||
return HttpResponse("Show all Birds")
|
return HttpResponse("Show all Birds")
|
||||||
|
|
||||||
|
|
||||||
|
def bird_recover_all(request):
|
||||||
|
return HttpResponse(f"Show all recovered Birds")
|
||||||
|
|
||||||
|
|
||||||
def bird_single(request, id):
|
def bird_single(request, id):
|
||||||
return HttpResponse(f"Show bird with ID {id}")
|
return HttpResponse(f"Show bird with ID {id}")
|
||||||
|
|
||||||
|
|
||||||
|
def bird_delete(request, id):
|
||||||
|
return HttpResponse(f"Show delete with ID {id}")
|
||||||
|
|
||||||
|
|
||||||
|
def bird_recover(request, id):
|
||||||
|
return HttpResponse(f"Show recover with ID {id}")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue