Code Completion in Latest Build Not Working Properly

Using 96.438, I can't seem to get code completion for Django to work properly.

For example, in models.py of a newly created app,

from django.db import models

# autocompletion works on .db, and on "models"

but for:

from django.shortcuts import

# autocompletion works for "shortcuts", but says no suggestions found for import

and for:

class Foo(models.Model)

# "Model" does not come up at all for autocompletion.

Am I not setting up PyCharm properly? This shouldn't be normal.

4 comments
Comment actions Permalink

Hello,

Could you please make sure that you have the correct Python interpreter selected

in Settings | Python Intepreters?

Also, which version of Django are you using?

I've checked this usecase on my machine, and everything works correctly.

Using 96.438, I can't seem to get code completion for Django to work

properly.

For example, in models.py of a newly created app,

from django.db import models

  1. autocompletion works on .db, and on "models"

but for:

from django.shortcuts import

  1. autocompletion works for "shortcuts", but says no suggestions found

for import

and for:

class Foo(models.Model)

  1. "Model" does not come up at all for autocompletion.

Am I not setting up PyCharm properly? This shouldn't be normal.

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0
Comment actions Permalink

Hi Dmitry,

I am using Python 2.6.2, installed on OSX at /Library/Frameworks/Python/framework/Versions/2.6/bin/python.

This is set as the path to my Python interpretor. (There are other paths automatically set, such as sitepackages)

I am using the latest Django - 1.2.1.

Thanks,

LXB

0
Comment actions Permalink

Just tried to update Python to 2.6.5, re-installed Django using "sudo python2.6 setup.py install",

then under PyCharm Python interpretor settings, clicked "reload"

same thing - only partial completion - it would complete something such as "django.shortcuts", but would not see inside the package.

I'm also not able to get code completion on field types, like:

foo = models.DateTimeField()

which leads me to think that something must not be setup properly - for example, completion works for "from django.contrib import flatpages". Also, all code completion works (for all above cases at least) under Komodo IDE, which means there's nothing inherently wrong with the Python/Django setup on my machine?

0
Comment actions Permalink

Any ideas on what I could do? Tried reinstalling and just about everything else, and could not get it to work.

Earlier builds worked fine, but do to the Default scheme save bug, I had to delete preferences and reinstall.

I've also noticed that django modules that pop up when typing "import django." - some at the top are highlighted in green, such as shortcuts and contrib. I am not able to get code complete on shortcut methods such as render_to_response.

Also, the code inspection highlights all my model Fields saying that they are not properly recognized - which I guess is why I cannot get code complete on something like "foo = models.DateTimeField()"

0

Please sign in to leave a comment.