-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed previous non-generic export and graph views
- Loading branch information
1 parent
8e51732
commit 56fbe81
Showing
11 changed files
with
114 additions
and
139 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
tapir/statistics/migrations/0006_remove_fancygraphcache_view_name_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 5.1.5 on 2025-01-30 17:47 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("statistics", "0005_merge_20241209_2116"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="fancygraphcache", | ||
name="view_name", | ||
), | ||
migrations.AddField( | ||
model_name="fancygraphcache", | ||
name="data_provider_name_name", | ||
field=models.CharField(default="unused", max_length=500), | ||
preserve_default=False, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin | ||
from drf_spectacular.utils import extend_schema | ||
from rest_framework import status | ||
from rest_framework.response import Response | ||
from rest_framework.views import APIView | ||
|
||
from tapir.settings import PERMISSION_COOP_MANAGE | ||
from tapir.statistics.serializers import ColumnSerializer, DatapointExportSerializer | ||
|
||
|
||
class AvailableColumnsView(LoginRequiredMixin, PermissionRequiredMixin, APIView): | ||
permission_required = PERMISSION_COOP_MANAGE | ||
|
||
@extend_schema( | ||
responses={200: ColumnSerializer(many=True)}, | ||
) | ||
def get(self, request): | ||
objects = [ | ||
{"column_name": column_name} | ||
for column_name in DatapointExportSerializer().get_fields().keys() | ||
] | ||
|
||
return Response( | ||
ColumnSerializer(objects, many=True).data, | ||
status=status.HTTP_200_OK, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin | ||
from django.views import generic | ||
|
||
from tapir.settings import PERMISSION_COOP_MANAGE | ||
|
||
|
||
class FancyExportView( | ||
LoginRequiredMixin, PermissionRequiredMixin, generic.TemplateView | ||
): | ||
permission_required = PERMISSION_COOP_MANAGE | ||
template_name = "statistics/fancy_export.html" | ||
|
||
def get_context_data(self, **kwargs): | ||
context_data = super().get_context_data(**kwargs) | ||
|
||
return context_data |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin | ||
from django.views import generic | ||
|
||
from tapir.settings import PERMISSION_COOP_MANAGE | ||
|
||
|
||
class FancyGraphView(LoginRequiredMixin, PermissionRequiredMixin, generic.TemplateView): | ||
permission_required = PERMISSION_COOP_MANAGE | ||
template_name = "statistics/fancy_graph.html" | ||
|
||
def get_context_data(self, **kwargs): | ||
context_data = super().get_context_data(**kwargs) | ||
|
||
return context_data |