8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-05 01:16:27 +00:00
re2o/tickets/views.py

27 lines
688 B
Python
Raw Normal View History

2019-07-06 08:25:24 +00:00
from django.shortcuts import render
2019-07-07 17:09:56 +00:00
from .models import(
Ticket
)
def new_ticket(request,user):
""" Vue de création d'un ticket """
ticket = NewTicketForm(request.POST or None, user=request.user)
if ticket.is_valid():
new_ticket_obj = machine.save(commit=False)
nex_ticket_obj.user = user
new_machine_obj.save()
return form(
{
'ticketform':ticket,
},
'ticket/ticket.html',
request
)
def aff_tickets(request):
""" Vue d'affichage de tout les tickets """
tickets = Ticket.objects.all()
return render(request,'tickets/aff_tickets.html',
{'tickets_list':tickets})