title: AttributeError at /checkout/ 'QuerySet' object has no attribute 'id'. can't access to my automactically created 'id model
body: <p>I'm a beginner at django. It's my first time to post there. That's why feel free to point if I have done something wrong.</p>
  <p>I'm doing 'e-commerce page' project. I'm using django 3.1.3. I can't get access to my 'id' model in my Order model:</p>
  <pre><code>from django.db import models
  from django.contrib.auth import get_user_model
  # Create your models here.
  from products.models import Product
  
  User = get_user_model()
  
  ORDER_STATUS_CHOICES = (
      ('created', 'Created'),
      ('stale', 'Stale'),
      ('paid', 'Paid'),
      ('shipped', 'Shipped'),
      ('refunded', 'Refunded'),
  )
  
  
  class Order(models.Model):
      user = models.ForeignKey(User, null=True, on_delete=models.SET_NULL)
      product = models.ForeignKey(Product, null=True, on_delete=models.SET_NULL)
      status = models.CharField(max_length=20, choices=ORDER_STATUS_CHOICES, default='created')
      sub_total = models.DecimalField(max_digits=10, decimal_places=2, default=0.00)
      price = models.DecimalField(max_digits=10, decimal_places=2, default=0.00)
      tax = models.DecimalField(max_digits=10, decimal_places=2, default=0.00)
      total = models.DecimalField(max_digits=10, decimal_places=2, default=0.00)
      paid = models.DecimalField(max_digits=10, decimal_places=2, default=0.00)
      shipping_address = models.TextField(blank=True, null=True)
      billing_adress = models.TextField(blank=True, null=True)
      timestamp = models.DateField(auto_now=True)
  </code></pre>
  <p>This is my view:</p>
  <pre><code>from django.shortcuts import render, redirect
  from django.contrib.auth.decorators import login_required
  
  # Create your views here.
  from .models import Order
  from products.models import Product
  
  @login_required
  def checkout_order(request):
      qs = Product.objects.filter(featured=True)
      if not qs.exists():
          return redirect('/')
      product = qs.first()
      user = request.user # without login_required there will be AnonUsers so we don't want it
      order_id = request.session.get('order_id')
      order_obj = None
      try: 
          order_obj = Order.objects.filter(id=order_id)
      except:
          order_id = None
      if order_id == None:
          order_obj = Order.objects.filter(product=product, user=user)
          request.session['order_id'] = order_obj.id
      print(order_obj.id)
      return render(request, 'forms.html', {})
  </code></pre>
  <p>I realized that in my try block I can't get access for 'id' model but don't know how to fix it since as far I know id model will be created automatically and there can't be 2 AutoField() fields. And I also tried to do with get() method <code>order_obj = Order.objects.filter(id=order_id)</code> but the result is the same.</p>
  <p>What am I doing wrong?</p>
  <p>EDIT: I made a mistake when copy/pasting the code and confused people. So in the second if statement <code>order_obj = Order.objects.filter(product=product, user=user)</code> should be <code>order_obj = Order.objects.create(product=product, user=user)</code> with create method not filter(). Sorry for this mistake.</p>