Esempio n. 1
0
class LicenceViewSet(PermissionInClassModelViewSet, viewsets.ModelViewSet):
    queryset = models.Licence.objects.all()
    serializer_class = serializers.modelserializer_factory(models.Licence, fields=['id', 'name'])
Esempio n. 2
0
class AudienceRoleViewSet(PermissionInClassModelViewSet, viewsets.ModelViewSet):
    queryset = models.AudienceRole.objects.all()
    serializer_class = serializers.modelserializer_factory(models.AudienceRole, fields=['id', 'audienceRole'])
Esempio n. 3
0
class FieldViewSet(PermissionInClassModelViewSet, viewsets.ModelViewSet):
    queryset = models.Field.objects.all()
    serializer_class = serializers.modelserializer_factory(models.Field, fields=['id', 'field'])
Esempio n. 4
0
class EventCostViewSet(PermissionInClassModelViewSet, viewsets.ModelViewSet):
    queryset = models.EventCost.objects.all()
    serializer_class = serializers.modelserializer_factory(models.EventCost, fields=['id', 'cost'])
Esempio n. 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']
Esempio n. 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'