# (help) Can't refer to model.objects from inside the code

**URL:** <https://forum.djangoproject.com/t/help-cant-refer-to-model-objects-from-inside-the-code/2814>\
**Category:** Using Django\
**Created:** [June 5, 2020, 4:38am UTC](https://forum.djangoproject.com/t/help-cant-refer-to-model-objects-from-inside-the-code/2814 "2020-06-05T04:38:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![viQcinese](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/viqcinese/32/1349_2.png) [@viQcinese](https://forum.djangoproject.com/u/viQcinese)\
**Post date:** [June 5, 2020, 4:38am UTC](https://forum.djangoproject.com/t/help-cant-refer-to-model-objects-from-inside-the-code/2814/1 "2020-06-05T04:38:42Z")

</div>

I have some models in models.py and I have no problem working with them in the shell. As I call Topic.objects.all(), for example, I get a list with every instance of Topic. But for some reason, as I’m working from the code, the .objects method (is it a method?) doesn’t work.

I’m working from PyCharm, and I get the following notification: "Unresolved attribute reference ‘objects’ for class ‘Topic’ "

Can somebody help me? Maybe I’m missing something obvious?

I’m guessing the problem is maybe in the inheritance from Models.model, because even from inside the Topic class I cannot call .objects

This is the code: [https://drive.google.com/file/d/1oHP3Xoz\_8tKH3B4UKw4edfpOaEJ3jnti/view?usp=sharing](https://drive.google.com/file/d/1oHP3Xoz_8tKH3B4UKw4edfpOaEJ3jnti/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![MaximilianKindshofer](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/maximiliankindshofer/32/835_2.png) [@MaximilianKindshofer](https://forum.djangoproject.com/u/MaximilianKindshofer)\
**Post date:** [June 5, 2020, 5:03am UTC](https://forum.djangoproject.com/t/help-cant-refer-to-model-objects-from-inside-the-code/2814/2 "2020-06-05T05:03:44Z")

</div>

Somehow Pycharm can’t follow the connection. But your code will probably work. it’s just the ide

---

<div class="post-metadata">

**Author:** ![viQcinese](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/viqcinese/32/1349_2.png) [@viQcinese](https://forum.djangoproject.com/u/viQcinese)\
**Post date:** [June 5, 2020, 5:11am UTC](https://forum.djangoproject.com/t/help-cant-refer-to-model-objects-from-inside-the-code/2814/3 "2020-06-05T05:11:06Z")

</div>

Thank’s for your help. I thought it may be so, but the data is also not getting to the template.

---

<div class="post-metadata">

**Author:** ![viQcinese](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/viqcinese/32/1349_2.png) [@viQcinese](https://forum.djangoproject.com/u/viQcinese)\
**Post date:** [June 5, 2020, 5:39am UTC](https://forum.djangoproject.com/t/help-cant-refer-to-model-objects-from-inside-the-code/2814/4 "2020-06-05T05:39:08Z")

</div>

Nope. You were right. Syntax error on the template. I dismissed it to early and spent too much time proof checking other codes. _sigh_
