model
class Products(models.Model):
UNIT = (
('whole', 'whole unit'),
('item', 'per single item'),
)
# category = models.ForeignKey(Category, related_name='products',
on_delete=models.CASCADE)
ProductName = models.CharField(max_length=255)
user = models.Fore
Try this:
def sell(request):
if request.method == 'POST':
form = ProductsForm(request.POST)
if form.is_valid():
print('form is valid')
form.save()
return redirect('home')
else:
form = ProductsForm()
retur
Some lessons about templates with django
On Mon, Jul 1, 2019 at 8:29 AM Joe Reitman wrote:
> Try this:
>
>
> def sell(request):
> if request.method == 'POST':
> form = ProductsForm(request.POST)
> if form.is_valid():
> print('form is valid')
>
3 matches
Mail list logo