# Path: exampleproject/lectures/models.py
# class Lecture(TenantSpecificFieldsModelMixin):
#     subject = models.CharField(max_length=100)
#     description = models.TextField()
#     speaker = models.ForeignKey(settings.AUTH_USER_MODEL)
# 
#     def __str__(self):
#         return '%s - %s' % (self.subject, self.speaker)
# 
# Path: exampleproject/lectures/serializers.py
# class LectureSerializer(TenantSpecificModelSerializer):
#     speaker_name = serializers.SerializerMethodField()
# 
#     class Meta:
#         model = Lecture
#         fields = ['id', 'subject', 'speaker', 'speaker_name', 'description']
# 
#     def get_speaker_name(self, obj):
#         return obj.speaker.first_name + ' ' + obj.speaker.last_name


from rest_framework import viewsets, permissions
from .models import Lecture
from .serializers import LectureSerializer


class LectureViewSet(viewsets.ModelViewSet):
    serializer_class = LectureSerializer
    permission_classes = [permissions.AllowAny]

    def get_queryset(self):

# Path: exampleproject/lectures/models.py
# class Lecture(TenantSpecificFieldsModelMixin):
#     subject = models.CharField(max_length=100)
#     description = models.TextField()
#     speaker = models.ForeignKey(settings.AUTH_USER_MODEL)
# 
#     def __str__(self):
#         return '%s - %s' % (self.subject, self.speaker)
# 
# Path: exampleproject/lectures/serializers.py
# class LectureSerializer(TenantSpecificModelSerializer):
#     speaker_name = serializers.SerializerMethodField()
# 
#     class Meta:
#         model = Lecture
#         fields = ['id', 'subject', 'speaker', 'speaker_name', 'description']
# 
#     def get_speaker_name(self, obj):
#         return obj.speaker.first_name + ' ' + obj.speaker.last_name


# Path: exampleproject/lectures/views.py
from rest_framework import viewsets, permissions
from .models import Lecture
from .serializers import LectureSerializer



class LectureViewSet(viewsets.ModelViewSet):
    serializer_class = LectureSerializer
    permission_classes = [permissions.AllowAny]

    def get_queryset(self):

        return Lecture.objects.all()