# Path: examples/django_rest_framework/backend/backend/api/mixins.py
# class ModelViewSet(FilterByKeyMixin, viewsets.ModelViewSet):
#     pass
# 
# Path: examples/django_rest_framework/backend/backend/api/models.py
# class Account(models.Model):
#     email = models.CharField(max_length=30)
# 
# class Reporter(models.Model):
#     account = models.OneToOneField(Account, related_name='reporter')
#     first_name = models.CharField(max_length=30)
#     last_name = models.CharField(max_length=30)
# 
# class Article(models.Model):
#     headline = models.CharField(max_length=100)
#     pub_date = models.DateField()
#     reporter = models.ForeignKey(Reporter, related_name='articles')
# 
# class Tag(models.Model):
#     label = models.CharField(max_length=30)
#     articles = models.ManyToManyField(Article, related_name='tags')


from .mixins import ModelViewSet
from .models import Account, Reporter, Article, Tag
from .serializers import AccountSerializer, ReporterSerializer, ArticleSerializer, \
    TagSerializer, ReversedReporterSerializer, ReversedArticleSerializer, \
    ReversedTagSerializer, ReversedAccountSerializer


# Filters and permissions are declared in settings


class AccountViewSet(ModelViewSet):
    queryset = Account.objects.all()
    serializer_class = AccountSerializer



# Path: examples/django_rest_framework/backend/backend/api/mixins.py
# class ModelViewSet(FilterByKeyMixin, viewsets.ModelViewSet):
#     pass
# 
# Path: examples/django_rest_framework/backend/backend/api/models.py
# class Account(models.Model):
#     email = models.CharField(max_length=30)
# 
# class Reporter(models.Model):
#     account = models.OneToOneField(Account, related_name='reporter')
#     first_name = models.CharField(max_length=30)
#     last_name = models.CharField(max_length=30)
# 
# class Article(models.Model):
#     headline = models.CharField(max_length=100)
#     pub_date = models.DateField()
#     reporter = models.ForeignKey(Reporter, related_name='articles')
# 
# class Tag(models.Model):
#     label = models.CharField(max_length=30)
#     articles = models.ManyToManyField(Article, related_name='tags')


# Path: examples/django_rest_framework/backend/backend/api/views.py
from .mixins import ModelViewSet
from .models import Account, Reporter, Article, Tag
from .serializers import AccountSerializer, ReporterSerializer, ArticleSerializer, \
    TagSerializer, ReversedReporterSerializer, ReversedArticleSerializer, \
    ReversedTagSerializer, ReversedAccountSerializer



# Filters and permissions are declared in settings


class AccountViewSet(ModelViewSet):
    queryset = Account.objects.all()
    serializer_class = AccountSerializer



class ReporterViewSet(ModelViewSet):