# Path: tests/fixtures/django4/notes/models.py
# class Note(models.Model):
#     note_text = models.CharField(max_length=200)
#     create_date = models.DateTimeField('date created')
# 
#     def __str__(self):
#         return self.note_text


import bugsnag
from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from django.views import generic
from django.utils import timezone
from django.urls import reverse
from .models import Note




class IndexView(generic.ListView):
    template_name = 'notes/index.html'
    context_object_name = 'latest_notes_list'

    def get_queryset(self):
        return Note.objects.order_by('-create_date')[:5]


class DetailView(generic.DetailView):
    model = Note


def add_note(request):
    note_text = request.POST['note_text']

# Path: tests/fixtures/django4/notes/models.py
# class Note(models.Model):
#     note_text = models.CharField(max_length=200)
#     create_date = models.DateTimeField('date created')
# 
#     def __str__(self):
#         return self.note_text


# Path: tests/fixtures/django4/notes/views.py
import bugsnag
from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from django.views import generic
from django.utils import timezone
from django.urls import reverse
from .models import Note





class IndexView(generic.ListView):
    template_name = 'notes/index.html'
    context_object_name = 'latest_notes_list'

    def get_queryset(self):
        return Note.objects.order_by('-create_date')[:5]


class DetailView(generic.DetailView):
    model = Note


def add_note(request):
    note_text = request.POST['note_text']

    note = Note(note_text=note_text, create_date=timezone.now())