Changes to payment models #32

Merged
valberg merged 35 commits from benjaoming/membersystem:payment-updates into main 2024-08-03 17:55:33 +00:00
2 changed files with 51 additions and 0 deletions
Showing only changes of commit 6bf42ecba3 - Show all commits

View file

@ -0,0 +1,13 @@
{% extends "base.html" %}
{% load i18n %}
{% block head_title %}
{% trans "Order" %}
{% endblock %}
{% block content %}
<div class="content-view">
<h2>Order: {{ order.id }}</h2>
</div>
{% endblock %}

38
src/accounting/views.py Normal file
View file

@ -0,0 +1,38 @@
"""Views for the membership app."""
from __future__ import annotations
from typing import TYPE_CHECKING
from django.shortcuts import render
from django_view_decorator import namespaced_decorator_factory
from . import models
if TYPE_CHECKING:
from django.http import HttpRequest
from django.http import HttpResponse
order_view = namespaced_decorator_factory(namespace="order", base_path="order")
@order_view(
paths="<int:order_id>/",
name="detail",
login_required=True,
)
def order_detail(request: HttpRequest, order_id: int) -> HttpResponse:
"""View to show the details of a member."""
user = request.user # People just need to login to pay something, not necessarily be a member
order = models.Order.objects.get(pk=order_id, member=user)
context = {
"order": order,
}
return render(
request=request,
template_name="accounting/order/detail.html",
context=context,
)