You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
657 B
17 lines
657 B
2 days ago
|
from django.shortcuts import render, redirect
|
||
|
from .forms import GoodsReceptionForm
|
||
|
from .models import GoodsReception
|
||
|
|
||
|
def goods_reception_list(request):
|
||
|
receptions = GoodsReception.objects.all()
|
||
|
return render(request, 'goods_reception/goods_reception_list.html', {'receptions': receptions})
|
||
|
|
||
|
def goods_reception_create(request):
|
||
|
if request.method == 'POST':
|
||
|
form = GoodsReceptionForm(request.POST)
|
||
|
if form.is_valid():
|
||
|
form.save()
|
||
|
return redirect('goods_reception_list')
|
||
|
else:
|
||
|
form = GoodsReceptionForm()
|
||
|
return render(request, 'goods_reception/goods_reception_form.html', {'form': form})
|