Python Forum
Working on an Auction Site - had questions
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working on an Auction Site - had questions
#10
wow thank you! It doesn't give me the error now.

Here is my code now. It doesn't give me an error but how can I test that it's actually putting the data into the db? The db doesn't exist in any format I know of where I can view it. Is there a way to print out the contents?

def auction(request):
    if request.method == "POST":
        title = request.POST.get("title")
        description = request.POST.get("description")
        price = request.POST.get("price")
        category = request.POST.get("category")
        new = NewPost.objects.create(title = title, description = description, price = price, category = category)
        new.save()
        return render(request, "auctions/auction.html")
    else:
        return render(request, "auctions/auction.html")
Reply


Messages In This Thread
RE: Working on an Auction Site - had questions - by card51shor - Sep-07-2020, 04:14 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020