Example #1
0
class LicenceViewSet(PermissionInClassModelViewSet, viewsets.ModelViewSet):
    queryset = models.Licence.objects.all()
    serializer_class = serializers.modelserializer_factory(models.Licence, fields=['id', 'name'])
Example #2
0
class AudienceRoleViewSet(PermissionInClassModelViewSet, viewsets.ModelViewSet):
    queryset = models.AudienceRole.objects.all()
    serializer_class = serializers.modelserializer_factory(models.AudienceRole, fields=['id', 'audienceRole'])
Example #3
0
class FieldViewSet(PermissionInClassModelViewSet, viewsets.ModelViewSet):
    queryset = models.Field.objects.all()
    serializer_class = serializers.modelserializer_factory(models.Field, fields=['id', 'field'])
Example #4
0
class EventCostViewSet(PermissionInClassModelViewSet, viewsets.ModelViewSet):
    queryset = models.EventCost.objects.all()
    serializer_class = serializers.modelserializer_factory(models.EventCost, fields=['id', 'cost'])
Example #5
0
class TopicViewSet(MultipleFieldLookupMixin, PermissionInClassModelViewSet, viewsets.ModelViewSet):
    queryset = models.Topic.objects.all()
    serializer_class = serializers.modelserializer_factory(models.Topic, fields=['id', 'uri', 'label'])
    lookup_fields = ['pk', 'uri__endswith']
Example #6
0
class OperatingSystemChoicesViewSet(PermissionInClassModelViewSet, viewsets.ModelViewSet):
    queryset = models.OperatingSystem.objects.all()
    serializer_class = serializers.modelserializer_factory(models.OperatingSystem, fields=['id', 'name'])
    lookup_field = 'name'