Documentation things.

This commit is contained in:
Chris GIACOFEI 2024-06-05 14:14:39 -04:00
parent 3717c2b844
commit 0d0f5e2373
2 changed files with 19 additions and 3 deletions

View File

@ -51,6 +51,7 @@ MIDDLEWARE = [
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.contrib.admindocs.middleware.XViewMiddleware',
# 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
# "django.contrib.flatpages.middleware.FlatpageFallbackMiddleware",
# 'django.contrib.messages.middleware.MessageMiddleware',

View File

@ -28,11 +28,26 @@ def home(request):
return render(request, 'yeast/home.html',{})
def batch(request, batch_id):
"""
Display a batch of yeast samples.
``Batch``
An instance of :model:`yeast.Batch`.
``Template``
:template:`yeast/batch.html`
"""
batch = get_object_or_404(Batch, pk=batch_id)
return render(request, 'yeast/batch.html', {'batch': batch})
def batch_labels(request, batch_id):
""" Create label PDF for samples in a batch
"""
Create label PDF for samples in a batch.
**Context**
``Batch``
An instance of :model:`yeast.Batch`.
"""
skip_count = request.POST.get("skip_count", "")
samples = request.POST.getlist("samples", "")