mirror of
https://github.com/lemeow125/DocManagerBackend.git
synced 2025-04-20 08:51:31 +08:00
Compare commits
No commits in common. "98e12dd15ea337e22a2e36374669cff80c464bdb" and "559baca38c2d711f87566836e6e5ac23f2876bac" have entirely different histories.
98e12dd15e
...
559baca38c
4 changed files with 5 additions and 161 deletions
|
@ -1,7 +1,7 @@
|
||||||
from rest_framework import generics
|
from rest_framework import generics
|
||||||
from rest_framework.permissions import IsAuthenticated
|
from rest_framework.permissions import IsAuthenticated
|
||||||
from rest_framework.pagination import PageNumberPagination
|
from rest_framework.pagination import PageNumberPagination
|
||||||
from accounts.permissions import IsHead, IsStaff
|
from accounts.permissions import IsHead
|
||||||
from rest_framework.pagination import PageNumberPagination
|
from rest_framework.pagination import PageNumberPagination
|
||||||
from .serializers import (
|
from .serializers import (
|
||||||
DocumentRequestCreationSerializer,
|
DocumentRequestCreationSerializer,
|
||||||
|
@ -45,13 +45,13 @@ class DocumentRequestListView(generics.ListAPIView):
|
||||||
class DocumentRequestFullListView(generics.ListAPIView):
|
class DocumentRequestFullListView(generics.ListAPIView):
|
||||||
"""
|
"""
|
||||||
Returns document requests. Always returns the link to download the document.
|
Returns document requests. Always returns the link to download the document.
|
||||||
Head is able to view all document requests here. Clients have no access, only staff.
|
Head is able to view all document requests here. Staff and clients have no access
|
||||||
"""
|
"""
|
||||||
|
|
||||||
http_method_names = ["get"]
|
http_method_names = ["get"]
|
||||||
serializer_class = DocumentRequestSerializer
|
serializer_class = DocumentRequestSerializer
|
||||||
pagination_class = PageNumberPagination
|
pagination_class = PageNumberPagination
|
||||||
permission_classes = [IsAuthenticated, IsStaff]
|
permission_classes = [IsAuthenticated, IsHead]
|
||||||
queryset = DocumentRequest.objects.all()
|
queryset = DocumentRequest.objects.all()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,3 @@
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from unfold.admin import ModelAdmin
|
|
||||||
|
|
||||||
from .models import Questionnaire
|
# Register your models here.
|
||||||
|
|
||||||
|
|
||||||
@admin.register(Questionnaire)
|
|
||||||
class QuestionnaireAdmin(ModelAdmin):
|
|
||||||
model = Questionnaire
|
|
||||||
search_fields = ["id", "date_submitted"]
|
|
||||||
list_display = ["id", "date_submitted"]
|
|
||||||
|
|
|
@ -1,148 +0,0 @@
|
||||||
# Generated by Django 5.1.3 on 2024-11-28 07:43
|
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
("questionnaires", "0001_initial"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = [
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="questionnaire",
|
|
||||||
name="sqd0_answer",
|
|
||||||
field=models.CharField(
|
|
||||||
choices=[
|
|
||||||
("1", "Strongly Disagree"),
|
|
||||||
("2", "Disagree"),
|
|
||||||
("3", "Neither Agree nor Disagree"),
|
|
||||||
("4", "Agree"),
|
|
||||||
("5", "Strongly Agree"),
|
|
||||||
("6", "N/A"),
|
|
||||||
],
|
|
||||||
max_length=16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="questionnaire",
|
|
||||||
name="sqd1_answer",
|
|
||||||
field=models.CharField(
|
|
||||||
choices=[
|
|
||||||
("1", "Strongly Disagree"),
|
|
||||||
("2", "Disagree"),
|
|
||||||
("3", "Neither Agree nor Disagree"),
|
|
||||||
("4", "Agree"),
|
|
||||||
("5", "Strongly Agree"),
|
|
||||||
("6", "N/A"),
|
|
||||||
],
|
|
||||||
max_length=16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="questionnaire",
|
|
||||||
name="sqd2_answer",
|
|
||||||
field=models.CharField(
|
|
||||||
choices=[
|
|
||||||
("1", "Strongly Disagree"),
|
|
||||||
("2", "Disagree"),
|
|
||||||
("3", "Neither Agree nor Disagree"),
|
|
||||||
("4", "Agree"),
|
|
||||||
("5", "Strongly Agree"),
|
|
||||||
("6", "N/A"),
|
|
||||||
],
|
|
||||||
max_length=16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="questionnaire",
|
|
||||||
name="sqd3_answer",
|
|
||||||
field=models.CharField(
|
|
||||||
choices=[
|
|
||||||
("1", "Strongly Disagree"),
|
|
||||||
("2", "Disagree"),
|
|
||||||
("3", "Neither Agree nor Disagree"),
|
|
||||||
("4", "Agree"),
|
|
||||||
("5", "Strongly Agree"),
|
|
||||||
("6", "N/A"),
|
|
||||||
],
|
|
||||||
max_length=16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="questionnaire",
|
|
||||||
name="sqd4_answer",
|
|
||||||
field=models.CharField(
|
|
||||||
choices=[
|
|
||||||
("1", "Strongly Disagree"),
|
|
||||||
("2", "Disagree"),
|
|
||||||
("3", "Neither Agree nor Disagree"),
|
|
||||||
("4", "Agree"),
|
|
||||||
("5", "Strongly Agree"),
|
|
||||||
("6", "N/A"),
|
|
||||||
],
|
|
||||||
max_length=16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="questionnaire",
|
|
||||||
name="sqd5_answer",
|
|
||||||
field=models.CharField(
|
|
||||||
choices=[
|
|
||||||
("1", "Strongly Disagree"),
|
|
||||||
("2", "Disagree"),
|
|
||||||
("3", "Neither Agree nor Disagree"),
|
|
||||||
("4", "Agree"),
|
|
||||||
("5", "Strongly Agree"),
|
|
||||||
("6", "N/A"),
|
|
||||||
],
|
|
||||||
max_length=16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="questionnaire",
|
|
||||||
name="sqd6_answer",
|
|
||||||
field=models.CharField(
|
|
||||||
choices=[
|
|
||||||
("1", "Strongly Disagree"),
|
|
||||||
("2", "Disagree"),
|
|
||||||
("3", "Neither Agree nor Disagree"),
|
|
||||||
("4", "Agree"),
|
|
||||||
("5", "Strongly Agree"),
|
|
||||||
("6", "N/A"),
|
|
||||||
],
|
|
||||||
max_length=16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="questionnaire",
|
|
||||||
name="sqd7_answer",
|
|
||||||
field=models.CharField(
|
|
||||||
choices=[
|
|
||||||
("1", "Strongly Disagree"),
|
|
||||||
("2", "Disagree"),
|
|
||||||
("3", "Neither Agree nor Disagree"),
|
|
||||||
("4", "Agree"),
|
|
||||||
("5", "Strongly Agree"),
|
|
||||||
("6", "N/A"),
|
|
||||||
],
|
|
||||||
max_length=16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
migrations.AlterField(
|
|
||||||
model_name="questionnaire",
|
|
||||||
name="sqd8_answer",
|
|
||||||
field=models.CharField(
|
|
||||||
choices=[
|
|
||||||
("1", "Strongly Disagree"),
|
|
||||||
("2", "Disagree"),
|
|
||||||
("3", "Neither Agree nor Disagree"),
|
|
||||||
("4", "Agree"),
|
|
||||||
("5", "Strongly Agree"),
|
|
||||||
("6", "N/A"),
|
|
||||||
],
|
|
||||||
max_length=16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]
|
|
|
@ -74,7 +74,7 @@ class Questionnaire(models.Model):
|
||||||
|
|
||||||
# SQD Questions
|
# SQD Questions
|
||||||
SQD_CHOICES = (
|
SQD_CHOICES = (
|
||||||
("1", "Strongly Disagree"),
|
("1", "Strongly disagree"),
|
||||||
("2", "Disagree"),
|
("2", "Disagree"),
|
||||||
("3", "Neither Agree nor Disagree"),
|
("3", "Neither Agree nor Disagree"),
|
||||||
("4", "Agree"),
|
("4", "Agree"),
|
||||||
|
|
Loading…
Add table
Reference in a new issue