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