PyDev 3.4.1 & Django 1.7: undefined variable from Import

238 views
Skip to first unread message

Florian Auer

unread,
May 12, 2014, 4:04:49 AM5/12/14
to django...@googlegroups.com
Hi folks

I'am new to django and try to follow the tutorial to digg into the code.

I am using eclipse 4.3.SR2 with PyDev 3.4.1 and Django 1.7.b2 (because of the new features)
In Tutorial Part 3 (https://docs.djangoproject.com/en/1.7/intro/tutorial03/) the database API is used to get the latest 5 objects

latest_question_list = Question.objects.order_by('-pub_date')[:5]

But my eclipse/PyDev does not resolve the objects correctly. "Question.objects" will e resolved bot not further on. This leads to the problem that PyDev is claiming about a "undefined variable from import: order_by"
I know that I can turn off this in the settings, but I would like to know if there is a way to bring this auto-completion feature to work.

The application is running correctly an on the python shell the auto-completion is also working.
So therefor I would think it is a PyDev problem or did I just missed to add something to the config?

Bill Freeman

unread,
May 12, 2014, 9:04:47 AM5/12/14
to django-users
But the code works, right?

This is a PyDev issue, not a Django issue.

(If you can only use code that your IDE understands, that leaves out a lot of interesting programs.)


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/13b3436a-402e-47ef-acfd-23fdbaf5166a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bill Freeman

unread,
May 12, 2014, 9:37:53 AM5/12/14
to django-users
Also, I don't think that it's the += that he's worried about.  What he's saying is that you shouldn't expect every sub-directory of BASE to always be an app, and/or that the order of INSTALLED_APPS can be important, and/or that your settings.py file should document what you are using.
Reply all
Reply to author
Forward
0 new messages