I
I
Ilya2015-03-07 14:33:00
Django
Ilya, 2015-03-07 14:33:00

Why doesn't autocomplete beyond Model.objects work in PyCharm. in django?

For example, there is

class Page(models.Model):
    category = models.ForeignKey(Category)
    title = models.CharField(max_length=128)
    url = models.URLField('Link')
    views = models.IntegerField(default=0)

In views.py I want to use
from app.models import Page
Page.objects.order_by('-views')

Actually the code itself works, but autocomplete after 'objects.' no longer offers anything. More precisely, it offers, but not that (only attributes like '__atr__')
PyCharm Professional Edition 4.0.4

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rostislav Grigoriev, 2015-03-12
@crazyzubr

Most likely you have a confusion with the paths. Point PyCharm to the Source directory (right click on the directory in the context menu)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question