# Path: mapaguarani/pages/serializers.py
# class FlatpageSerializer(serializers.ModelSerializer):
# 
#     class Meta:
#         model = Page
#         fields = ['id', 'url', 'title', 'content', 'position',]
# 
# Path: mapaguarani/pages/models.py
# class Page(FlatPage):
#     position = models.IntegerField(_('Position'), default=0, null=True, blank=True)
# 
#     class Meta:
#         verbose_name = _('Page')
#         verbose_name_plural = _('Pages')


from rest_framework import viewsets
from django.contrib.sites.models import Site
from .serializers import FlatpageSerializer
from .models import Page


class FlatpageViewSet(viewsets.ReadOnlyModelViewSet):

    # model = Page
    queryset = Page.objects.all()
    serializer_class = FlatpageSerializer

# Path: mapaguarani/pages/serializers.py
# class FlatpageSerializer(serializers.ModelSerializer):
# 
#     class Meta:
#         model = Page
#         fields = ['id', 'url', 'title', 'content', 'position',]
# 
# Path: mapaguarani/pages/models.py
# class Page(FlatPage):
#     position = models.IntegerField(_('Position'), default=0, null=True, blank=True)
# 
#     class Meta:
#         verbose_name = _('Page')
#         verbose_name_plural = _('Pages')


# Path: mapaguarani/pages/views.py
from rest_framework import viewsets
from django.contrib.sites.models import Site
from .serializers import FlatpageSerializer
from .models import Page



class FlatpageViewSet(viewsets.ReadOnlyModelViewSet):

    # model = Page
    queryset = Page.objects.all()
    serializer_class = FlatpageSerializer

    filter_fields = ('url',)