# Django Part 1 getting an error not defined

**URL:** <https://forum.codewithmosh.com/t/django-part-1-getting-an-error-not-defined/7543>\
**Category:** Django\
**Created:** [September 26, 2021, 2:41am UTC](https://forum.codewithmosh.com/t/django-part-1-getting-an-error-not-defined/7543 "2021-09-26T02:41:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![asadbek](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@asadbek](https://forum.codewithmosh.com/u/asadbek)\
**Post date:** [September 26, 2021, 2:41am UTC](https://forum.codewithmosh.com/t/django-part-1-getting-an-error-not-defined/7543/1 "2021-09-26T02:41:42Z")

</div>

File “C:\Django\market\store\models.py”, line 37, in Order  
(PAYMENT\_STATUS\_PENDING, ‘Pending’),  
NameError: name ‘PAYMENT\_STATUS\_PENDING’ is not defined

---

<div class="post-metadata">

**Author:** ![RanaMoizHaider](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/ranamoizhaider/32/2313_2.png) [@RanaMoizHaider](https://forum.codewithmosh.com/u/RanaMoizHaider)\
**Post date:** [September 26, 2021, 5:45am UTC](https://forum.codewithmosh.com/t/django-part-1-getting-an-error-not-defined/7543/2 "2021-09-26T05:45:39Z")

</div>

I think you are missing something in the code. It will be helpful if you show the code you’ve written for the class 🙂  
Or you can try this one:

```auto
class Order(models.Model):
    PAYMENT_STATUS_PENDING = 'P'
    PAYMENT_STATUS_COMPLETE = 'C'
    PAYMENT_STATUS_FAILED = 'F'

    PAYMENT_STATUS_CHOICES = [
        (PAYMENT_STATUS_PENDING, 'Pending'),
        (PAYMENT_STATUS_COMPLETE, 'Complete'),
        (PAYMENT_STATUS_FAILED, 'Failed')
    ]
    placed_at = models.DateTimeField(auto_now_add=True)
    payment_status = models.CharField(max_length=1, choices=PAYMENT_STATUS_CHOICES, default=PAYMENT_STATUS_PENDING)

```

---

<div class="post-metadata">

**Author:** ![asadbek](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@asadbek](https://forum.codewithmosh.com/u/asadbek)\
**Post date:** [September 28, 2021, 2:39pm UTC](https://forum.codewithmosh.com/t/django-part-1-getting-an-error-not-defined/7543/3 "2021-09-28T14:39:26Z")

</div>

Thanks, it has worked
