mirror of https://github.com/fspc/workstand.git
Drew Larson
8 years ago
4 changed files with 32 additions and 1 deletions
@ -0,0 +1,8 @@ |
|||||
|
from rest_framework import serializers |
||||
|
|
||||
|
from bike.models import Bike |
||||
|
|
||||
|
|
||||
|
class BikeSerializer(serializers.HyperlinkedModelSerializer): |
||||
|
class Meta: |
||||
|
model = Bike |
@ -1,7 +1,13 @@ |
|||||
from django.conf.urls import url |
from django.conf.urls import url, include |
||||
|
from rest_framework import routers |
||||
|
|
||||
|
from bike import views |
||||
from .views import BikesView |
from .views import BikesView |
||||
|
|
||||
|
router = routers.DefaultRouter() |
||||
|
router.register(r'bikes', views.BikeViewSet) |
||||
|
|
||||
urlpatterns = [ |
urlpatterns = [ |
||||
|
url(r'^api/', include(router.urls, namespace='api')), |
||||
url(r'^$', BikesView.as_view(), name='bikes') |
url(r'^$', BikesView.as_view(), name='bikes') |
||||
] |
] |
||||
|
Loading…
Reference in new issue