<commit_before>from django.shortcuts import render, get_object_or_404
from .serializers import (WellSerializer, NoteSerializer, DeviceDataSerializer,
                          DeviceOutputSerializer, UsageSerializer,
                          WaterTestSerializer, TestSerializer, HourlyUsageSerializer)
from django.views import generic
from rest_framework import viewsets, generics, filters
from .models import Well, Note, DeviceData, Usage, WaterTest, Test, DeviceOutput, HourlyUsage
from django.views.decorators.cache import cache_page
from django.db.models import Avg, Count, Sum, F
from django.db.models.functions import TruncDate


class WellViewSet(viewsets.ModelViewSet):
    queryset = Well.objects.all()
    serializer_class = WellSerializer


class NoteViewSet(viewsets.ModelViewSet):
    queryset = Note.objects.all()
    serializer_class = NoteSerializer


class DeviceDataViewSet(viewsets.ModelViewSet):
    queryset = DeviceData.objects.all()
    serializer_class = DeviceDataSerializer


class UsageViewSet(viewsets.ModelViewSet):
    queryset = Usage.objects.all()
    serializer_class = UsageSerializer


class WaterTestViewSet(viewsets.ModelViewSet):
    queryset = WaterTest.objects.all()<commit_msg>Sorted Notes by date, first: newest<commit_after>from django.shortcuts import render, get_object_or_404
from .serializers import (WellSerializer, NoteSerializer, DeviceDataSerializer,
                          DeviceOutputSerializer, UsageSerializer,
                          WaterTestSerializer, TestSerializer, HourlyUsageSerializer)
from django.views import generic
from rest_framework import viewsets, generics, filters
from .models import Well, Note, DeviceData, Usage, WaterTest, Test, DeviceOutput, HourlyUsage
from django.views.decorators.cache import cache_page
from django.db.models import Avg, Count, Sum, F
from django.db.models.functions import TruncDate


class WellViewSet(viewsets.ModelViewSet):
    queryset = Well.objects.all()
    serializer_class = WellSerializer


class NoteViewSet(viewsets.ModelViewSet):
    queryset = Note.objects.all().order_by('created')
    print(queryset[0])
    serializer_class = NoteSerializer


class DeviceDataViewSet(viewsets.ModelViewSet):
    queryset = DeviceData.objects.all()
    serializer_class = DeviceDataSerializer


class UsageViewSet(viewsets.ModelViewSet):
    queryset = Usage.objects.all()
    serializer_class = UsageSerializer


class WaterTestViewSet(viewsets.ModelViewSet):
    queryset = WaterTest.objects.all()
{'fraction_non_alphanumeric': 0.07311226528166201, 'fraction_numerical': 0.002796644027167399, 'mean_word_length': 4.71689497716895, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '879587', 'n_tokens_mistral': 692, 'n_tokens_neox': 661, 'n_words': 165}