<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Teguh Eko Budiarto &#187; IDE</title>
	<atom:link href="http://teguheko.echodess.com/category/programming/ide/feed/" rel="self" type="application/rss+xml" />
	<link>http://teguheko.echodess.com</link>
	<description>Web Programming and Sharing Experience</description>
	<lastBuildDate>Sat, 21 Aug 2010 07:51:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Netbeans Python Intellisense</title>
		<link>http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/</link>
		<comments>http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 02:07:11 +0000</pubDate>
		<dc:creator>Teguh Eko Budiarto</dc:creator>
				<category><![CDATA[IDE]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://teguheko.echodess.com/?p=81</guid>
		<description><![CDATA[Since Python is not a strongly typed programming language, you do not have to specify your variable type. This is nice but have some drawback for Netbeans, which it can not recognize the type easily so you can not have good suggestion for the intellisense feature. To fix that you have to specify the type [...]]]></description>
			<content:encoded><![CDATA[<p>Since Python is not a strongly typed programming language, you do not have to specify your variable type. This is nice but have some drawback for Netbeans, which it can not recognize the type easily so you can not have good suggestion for the intellisense feature. To fix that you have to specify the type of your variable and make sure you already import the correct module.</p>
<p>For example, when you have this kind of code (below code are for example purpose only)</p>
<pre class="brush: python">
from datetime import datetime
from django.db import models
from django.utils.translation import gettext_lazy as _

class Poll(models.Model):
    question = models.CharField(max_length=200)
    password = models.CharField(max_length=200)
    pub_date = models.DateTimeField(_('date published'), default=datetime.now)
    class Admin:
        pass
    def __str__(self):
        return self.question
    def get_choice_list(self):
        return list(self.choice_set.order_by('id'))
    def get_choice_from_num(self, choice_num):
        try:
            return self.get_choice_list()[int(choice_num)-1]
        except IndexError:
            raise Choice.DoesNotExist

class Choice(models.Model):
    poll = models.ForeignKey(Poll)
    choice = models.CharField(max_length=200)
    votes = models.IntegerField()
    class Admin:
        pass
    def __str__(self):
        return self.choice
    def get_num(self):
        try:
            return self.poll.get_choice_list().index(self)+1
        except ValueError:
            raise Choice.DoesNotExist
</pre>
<p>For people like me, usually the first thing I do when want to use a defined variable is to hit the ctrl-space button to display the Intellisense suggestion. But in this case, when I want to use functions or variables defined in the attribute <strong>poll</strong> in <strong>Choice</strong> class, it displays :<br />
<a href="http://teguheko.echodess.com/wp-content/uploads/2009/10/specify-type-netbeans-python.jpg" title="specify type netbeans python"><img src="http://teguheko.echodess.com/wp-content/uploads/2009/10/specify-type-netbeans-python-1024x346.jpg" alt="specify type netbeans python" title="specify type netbeans python" width="600" height="202" class="aligncenter size-large wp-image-82" /></a></p>
<p>Which means Netbeans does&#8217;nt understand the type and the intellisense just throw all the types available to you and it become garbage, instead of suggestion. To teach Netbeans the type of the variable, just click the <strong>Specify type of [the variable name]</strong> menu, and then type your variable&#8217;s type. After that the intellisense will give you nice result, like this picture below:<br />
<a href="http://teguheko.echodess.com/wp-content/uploads/2009/10/specified-type-netbeans-python.jpg" title="specified type netbeans python"><img src="http://teguheko.echodess.com/wp-content/uploads/2009/10/specified-type-netbeans-python.jpg" alt="specified type netbeans python" title="specified type netbeans python" width="685" height="346" class="aligncenter size-full wp-image-83" /></a></p>
<p>Other thing is to make sure you have imported your class in your file so Netbeans will recognized it properly. Hope it helps, Cheers! <img src='http://teguheko.echodess.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-bg-caring-old"><ul class="socials"><li class="sexy-scriptstyle"><a href="http://scriptandstyle.com/submit?url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;title=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Submit this to Script &amp; Style">Submit this to Script &amp; Style</a></li><li class="sexy-blinklist"><a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;Title=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Share this on Blinklist">Share this on Blinklist</a></li><li class="sexy-delicious"><a href="http://del.icio.us/post?url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;title=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li class="sexy-digg"><a href="http://digg.com/submit?phase=2&amp;url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;title=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Digg this!">Digg this!</a></li><li class="sexy-diigo"><a href="http://www.diigo.com/post?url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;title=Netbeans+Python+Intellisense&amp;desc=Since%20Python%20is%20not%20a%20strongly%20typed%20programming%20language%2C%20you%20do%20not%20have%20to%20specify%20your%20variable%20type.%20This%20is%20nice%20but%20have%20some%20drawback%20for%20Netbeans%2C%20which%20it%20can%20not%20recognize%20the%20type%20easily%20so%20you%20can%20not%20have%20good%20suggestion%20for%20the%20intellisense%20feature.%20To%20fix%20that%20you%20have%20to%20specify%20the" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a></li><li class="sexy-reddit"><a href="http://reddit.com/submit?url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;title=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a></li><li class="sexy-yahoobuzz"><a href="http://buzz.yahoo.com/submit/?submitUrl=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;submitHeadline=Netbeans+Python+Intellisense&amp;submitSummary=Since%20Python%20is%20not%20a%20strongly%20typed%20programming%20language%2C%20you%20do%20not%20have%20to%20specify%20your%20variable%20type.%20This%20is%20nice%20but%20have%20some%20drawback%20for%20Netbeans%2C%20which%20it%20can%20not%20recognize%20the%20type%20easily%20so%20you%20can%20not%20have%20good%20suggestion%20for%20the%20intellisense%20feature.%20To%20fix%20that%20you%20have%20to%20specify%20the&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a></li><li class="sexy-stumbleupon"><a href="http://www.stumbleupon.com/submit?url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;title=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li class="sexy-technorati"><a href="http://technorati.com/faves?add=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a></li><li class="sexy-mixx"><a href="http://www.mixx.com/submit?page_url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;title=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a></li><li class="sexy-myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;t=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a></li><li class="sexy-designfloat"><a href="http://www.designfloat.com/submit.php?url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;title=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Submit this to DesignFloat">Submit this to DesignFloat</a></li><li class="sexy-facebook"><a href="http://www.facebook.com/share.php?u=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;t=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a></li><li class="sexy-twitter"><a href="http://twitter.com/home?status=Netbeans Python Intellisense+-+http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/+" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a></li><li class="sexy-comfeed"><a href="http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a></li><li class="sexy-linkedin"><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;title=Netbeans+Python+Intellisense&amp;summary=Since%20Python%20is%20not%20a%20strongly%20typed%20programming%20language%2C%20you%20do%20not%20have%20to%20specify%20your%20variable%20type.%20This%20is%20nice%20but%20have%20some%20drawback%20for%20Netbeans%2C%20which%20it%20can%20not%20recognize%20the%20type%20easily%20so%20you%20can%20not%20have%20good%20suggestion%20for%20the%20intellisense%20feature.%20To%20fix%20that%20you%20have%20to%20specify%20the&amp;source=Teguh Eko Budiarto" rel="nofollow" class="external" title="Share this on Linkedin">Share this on Linkedin</a></li><li class="sexy-newsvine"><a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;h=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Seed this on Newsvine">Seed this on Newsvine</a></li><li class="sexy-devmarks"><a href="http://devmarks.com/index.php?posttext=Since%20Python%20is%20not%20a%20strongly%20typed%20programming%20language%2C%20you%20do%20not%20have%20to%20specify%20your%20variable%20type.%20This%20is%20nice%20but%20have%20some%20drawback%20for%20Netbeans%2C%20which%20it%20can%20not%20recognize%20the%20type%20easily%20so%20you%20can%20not%20have%20good%20suggestion%20for%20the%20intellisense%20feature.%20To%20fix%20that%20you%20have%20to%20specify%20the&amp;posturl=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;posttitle=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Share this on Devmarks">Share this on Devmarks</a></li><li class="sexy-google"><a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;title=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a></li><li class="sexy-misterwong"><a href="http://www.mister-wong.com/addurl/?bm_url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;bm_description=Netbeans+Python+Intellisense&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a></li><li class="sexy-izeby"><a href="http://izeby.com/submit.php?url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/" rel="nofollow" class="external" title="Add this to Izeby">Add this to Izeby</a></li><li class="sexy-tipd"><a href="http://tipd.com/submit.php?url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/" rel="nofollow" class="external" title="Share this on Tipd">Share this on Tipd</a></li><li class="sexy-pfbuzz"><a href="http://pfbuzz.com/submit?url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;title=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Share this on PFBuzz">Share this on PFBuzz</a></li><li class="sexy-friendfeed"><a href="http://www.friendfeed.com/share?title=Netbeans+Python+Intellisense&amp;link=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/" rel="nofollow" class="external" title="Share this on FriendFeed">Share this on FriendFeed</a></li><li class="sexy-blogmarks"><a href="http://blogmarks.net/my/new.php?mini=1&amp;simple=1&amp;url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;title=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Mark this on BlogMarks">Mark this on BlogMarks</a></li><li class="sexy-twittley"><a href="http://twittley.com/submit/?title=Netbeans+Python+Intellisense&amp;url=http%3A%2F%2Fteguheko.echodess.com%2F2009%2F10%2Fnetbeans-python-intellisense%2F&amp;desc=Since%20Python%20is%20not%20a%20strongly%20typed%20programming%20language%2C%20you%20do%20not%20have%20to%20specify%20your%20variable%20type.%20This%20is%20nice%20but%20have%20some%20drawback%20for%20Netbeans%2C%20which%20it%20can%20not%20recognize%20the%20type%20easily%20so%20you%20can%20not%20have%20good%20suggestion%20for%20the%20intellisense%20feature.%20To%20fix%20that%20you%20have%20to%20specify%20the&amp;pcat=Technology&amp;tags=default" rel="nofollow" class="external" title="Submit this to Twittley">Submit this to Twittley</a></li><li class="sexy-fwisp"><a href="http://fwisp.com/submit?url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/" rel="nofollow" class="external" title="Share this on Fwisp">Share this on Fwisp</a></li><li class="sexy-designmoo"><a href="http://designmoo.com/submit?url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;title=Netbeans+Python+Intellisense&amp;body=Since%20Python%20is%20not%20a%20strongly%20typed%20programming%20language%2C%20you%20do%20not%20have%20to%20specify%20your%20variable%20type.%20This%20is%20nice%20but%20have%20some%20drawback%20for%20Netbeans%2C%20which%20it%20can%20not%20recognize%20the%20type%20easily%20so%20you%20can%20not%20have%20good%20suggestion%20for%20the%20intellisense%20feature.%20To%20fix%20that%20you%20have%20to%20specify%20the" rel="nofollow" class="external" title="Moo this on DesignMoo!">Moo this on DesignMoo!</a></li><li class="sexy-bobrdobr"><a href="http://bobrdobr.ru/addext.html?url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;title=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Share this on BobrDobr">Share this on BobrDobr</a></li><li class="sexy-yandex"><a href="http://zakladki.yandex.ru/userarea/links/addfromfav.asp?bAddLink_x=1&amp;lurl=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;lname=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Add this to Yandex.Bookmarks">Add this to Yandex.Bookmarks</a></li><li class="sexy-memoryru"><a href="http://memori.ru/link/?sm=1&amp;u_data[url]=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;u_data[name]=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Add this to Memory.ru">Add this to Memory.ru</a></li><li class="sexy-100zakladok"><a href="http://www.100zakladok.ru/save/?bmurl=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;bmtitle=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Add this to 100 bookmarks">Add this to 100 bookmarks</a></li><li class="sexy-moemesto"><a href="http://moemesto.ru/post.php?url=http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/&amp;title=Netbeans+Python+Intellisense" rel="nofollow" class="external" title="Add this to MyPlace">Add this to MyPlace</a></li></ul><div style="clear:both;"></div></div>]]></content:encoded>
			<wfw:commentRss>http://teguheko.echodess.com/2009/10/netbeans-python-intellisense/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
