# -*- coding: utf-8 -*-

# from django.urls import path
from django.conf.urls import url, include
# from django.contrib.auth.models import User
from rest_framework import routers, serializers, viewsets
from webfj_django_doutu.models import Table

# Serializers define the API representation.
class TableSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Table
        fields = ('id', 'title', 'img_url')

# ViewSets define the view behavior.
class TableViewSet(viewsets.ModelViewSet):
    queryset = Table.objects.all()
    serializer_class = TableSerializer

# Routers provide an easy way of automatically determining the URL conf.
router = routers.DefaultRouter()
router.register(r'doutu_list', TableViewSet)

# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
    url(r'^api/', include(router.urls)),
    # url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]

# -*- coding: utf-8 -*-

# from django.urls import path
from django.conf.urls import url, include
# from django.contrib.auth.models import User
from rest_framework import routers, serializers, viewsets
from webfj_django_doutu.models import Table

# Serializers define the API representation.
class TableSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Table
        fields = ('id', 'title', 'img_url')

# ViewSets define the view behavior.
class TableViewSet(viewsets.ModelViewSet):
    queryset = Table.objects.all()
    serializer_class = TableSerializer

# Routers provide an easy way of automatically determining the URL conf.
router = routers.DefaultRouter()
router.register(r'doutu_list', TableViewSet)

# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
    url(r'^api/', include(router.urls)),
    # url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]

# -*- coding: utf-8 -*- # from django.urls import path # from django.contrib.auth.models import User # Serializers define the API representation. # ViewSets define the view behavior. # Routers provide an easy way of automatically determining the URL conf. # Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browsable API. # url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))