<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.2" -->
<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/"
	>

<channel>
	<title>Rachel's Blog</title>
	<link>http://www.willmer.com/kb</link>
	<description></description>
	<pubDate>Sun, 17 Aug 2008 16:46:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>
	<language>en</language>
			<item>
		<title>Migrating sequences to Postgres</title>
		<link>http://www.willmer.com/kb/2008/08/migrating-sequences-to-postgres/</link>
		<comments>http://www.willmer.com/kb/2008/08/migrating-sequences-to-postgres/#comments</comments>
		<pubDate>Sun, 17 Aug 2008 16:46:20 +0000</pubDate>
		<dc:creator>Rachel</dc:creator>
		
		<category><![CDATA[mysql]]></category>

		<category><![CDATA[postgres]]></category>

		<guid isPermaLink="false">http://www.willmer.com/kb/2008/08/migrating-sequences-to-postgres/</guid>
		<description><![CDATA[When moving a database from mysql to postgres, it&#8217;s often necessary to reset the sequences (.i.e. autoupdated row ids)
Find out what the largest one is with select max (id) from mytable;
Set the sequence with select setval('mytable_id_seq',x+1) ;
]]></description>
			<content:encoded><![CDATA[<p>When moving a database from mysql to postgres, it&#8217;s often necessary to reset the sequences (.i.e. autoupdated row ids)</p>
<p>Find out what the largest one is with <code>select max (id) from mytable;</code></p>
<p>Set the sequence with <code>select setval('mytable_id_seq',x+1) ;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.willmer.com/kb/2008/08/migrating-sequences-to-postgres/feed/</wfw:commentRss>
		</item>
		<item>
		<title>UnicodeDecodeError using BeautifulSoup</title>
		<link>http://www.willmer.com/kb/2008/08/unicodedecodeerror-using-beautifulsoup/</link>
		<comments>http://www.willmer.com/kb/2008/08/unicodedecodeerror-using-beautifulsoup/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 09:13:25 +0000</pubDate>
		<dc:creator>Rachel</dc:creator>
		
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.willmer.com/kb/2008/08/unicodedecodeerror-using-beautifulsoup/</guid>
		<description><![CDATA[UnicodeDecodeError: 'ascii' codec can't decode byte 0xa3 in position 0: ordinal not in range(128)
There&#8217;s a rather annoying bug in python 2.5&#8217;s sgmllib.py which is the cause.
The function convert_charref assumes that ascii characters have values up to 255; the correct limit is 127.
]]></description>
			<content:encoded><![CDATA[<p><code>UnicodeDecodeError: 'ascii' codec can't decode byte 0xa3 in position 0: ordinal not in range(128)</code></p>
<p>There&#8217;s a rather annoying bug in python 2.5&#8217;s sgmllib.py which is the cause.</p>
<p>The function convert_charref assumes that ascii characters have values up to 255; the correct limit is 127.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.willmer.com/kb/2008/08/unicodedecodeerror-using-beautifulsoup/feed/</wfw:commentRss>
		</item>
		<item>
		<title>login in testing - must call GET before doing POST</title>
		<link>http://www.willmer.com/kb/2008/07/login-in-testing-must-call-get-before-doing-post/</link>
		<comments>http://www.willmer.com/kb/2008/07/login-in-testing-must-call-get-before-doing-post/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 09:28:03 +0000</pubDate>
		<dc:creator>Rachel</dc:creator>
		
		<category><![CDATA[django]]></category>

		<guid isPermaLink="false">http://www.willmer.com/kb/2008/07/login-in-testing-must-call-get-before-doing-post/</guid>
		<description><![CDATA[In 0.96, if you dive straight in with a POST to your login page with username/password, you&#8217;ll get a login error, saying &#8220;Your Web browser doesn&#8217;t appear to have cookies enabled. Cookies are required for logging in.&#8221;.
This is because the test cookie only gets set when you do a GET.
So doing this works:

   [...]]]></description>
			<content:encoded><![CDATA[<p>In 0.96, if you dive straight in with a POST to your login page with username/password, you&#8217;ll get a login error, saying &#8220;Your Web browser doesn&#8217;t appear to have cookies enabled. Cookies are required for logging in.&#8221;.</p>
<p>This is because the test cookie only gets set when you do a GET.</p>
<p>So doing this works:</p>
<p><code><br />
        response=client.get(login_page)<br />
        response=client.post(login_page, {'username': username, 'password': password, 'next': home_page})<br />
</code></p>
<p>But just doing the post doesn&#8217;t.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.willmer.com/kb/2008/07/login-in-testing-must-call-get-before-doing-post/feed/</wfw:commentRss>
		</item>
		<item>
		<title>test.Client problems logging in (now fixed)</title>
		<link>http://www.willmer.com/kb/2008/07/testclient-problems-logging-in-now-fixed/</link>
		<comments>http://www.willmer.com/kb/2008/07/testclient-problems-logging-in-now-fixed/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 12:22:53 +0000</pubDate>
		<dc:creator>Rachel</dc:creator>
		
		<category><![CDATA[django]]></category>

		<guid isPermaLink="false">http://www.willmer.com/kb/2008/07/testclient-problems-logging-in-now-fixed/</guid>
		<description><![CDATA[If you&#8217;re creating a test user for a unit test, do it this way:

newuser=User.objects.create_user('john', 'lennon@thebeatles.com', 'johnpassword')

rather than this:

newuser=User(username="john",email="lennon@thebeatles.com",password="johnpassword")

The latter looks correct, but you&#8217;ll get problems logging in since Django stores the *hash* of the password in the db, not the clear text.
Another gotcha is that the client.login() function only works with pages where you can&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re creating a test user for a unit test, do it this way:</p>
<p><code><br />
newuser=User.objects.create_user('john', 'lennon@thebeatles.com', 'johnpassword')<br />
</code></p>
<p>rather than this:</p>
<p><code><br />
newuser=User(username="john",email="lennon@thebeatles.com",password="johnpassword")<br />
</code></p>
<p>The latter looks correct, but you&#8217;ll get problems logging in since Django stores the *hash* of the password in the db, not the clear text.</p>
<p>Another gotcha is that the client.login() function only works with pages where you can&#8217;t get at them until you have logged in - if the page is available to AnonymousUser, then login() will always fail.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.willmer.com/kb/2008/07/testclient-problems-logging-in-now-fixed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>&#8216;module&#8217; object has no attribute &#8216;day_abbr&#8217;</title>
		<link>http://www.willmer.com/kb/2008/07/module-object-has-no-attribute-day_abbr/</link>
		<comments>http://www.willmer.com/kb/2008/07/module-object-has-no-attribute-day_abbr/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 13:03:54 +0000</pubDate>
		<dc:creator>Rachel</dc:creator>
		
		<category><![CDATA[django]]></category>

		<guid isPermaLink="false">http://www.willmer.com/kb/2008/07/module-object-has-no-attribute-day_abbr/</guid>
		<description><![CDATA[This means you have a naming conflict between the core python module calendar and another one which is taking precendence.
If you&#8217;ve got your own module called calendar, rename it&#8230;
]]></description>
			<content:encoded><![CDATA[<p>This means you have a naming conflict between the core python module calendar and another one which is taking precendence.</p>
<p>If you&#8217;ve got your own module called calendar, rename it&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.willmer.com/kb/2008/07/module-object-has-no-attribute-day_abbr/feed/</wfw:commentRss>
		</item>
		<item>
		<title>More Wii Fit goodies</title>
		<link>http://www.willmer.com/kb/2008/06/more-wii-fit-goodies/</link>
		<comments>http://www.willmer.com/kb/2008/06/more-wii-fit-goodies/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 17:26:42 +0000</pubDate>
		<dc:creator>Rachel</dc:creator>
		
		<category><![CDATA[my websites]]></category>

		<guid isPermaLink="false">http://www.willmer.com/kb/2008/06/more-wii-fit-goodies/</guid>
		<description><![CDATA[Now I&#8217;ve got a Wii Fit, I want other games to play on the board  
Wii Fit Games Info
]]></description>
			<content:encoded><![CDATA[<p>Now I&#8217;ve got a Wii Fit, I want other games to play on the board <img src='http://www.willmer.com/kb/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a href="http://www.wiifitgames.info">Wii Fit Games Info</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.willmer.com/kb/2008/06/more-wii-fit-goodies/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to access the Django request inside a Template Tag</title>
		<link>http://www.willmer.com/kb/2008/06/how-to-access-the-django-request-inside-a-template-tag/</link>
		<comments>http://www.willmer.com/kb/2008/06/how-to-access-the-django-request-inside-a-template-tag/#comments</comments>
		<pubDate>Sat, 21 Jun 2008 08:39:40 +0000</pubDate>
		<dc:creator>Rachel</dc:creator>
		
		<category><![CDATA[django]]></category>

		<guid isPermaLink="false">http://www.willmer.com/kb/2008/06/how-to-access-the-django-request-inside-a-template-tag/</guid>
		<description><![CDATA[You can access the Django request within a Template Tag by enabling the request context processor.
If you&#8217;re using a generic view, for example, &#8216;direct_to_template&#8217;, your render() function will then be passed a RequestContext , and you can access the request by context[&#8217;request&#8217;].
If you&#8217;re not using a generic view, and are using render_to_response(), then you have [...]]]></description>
			<content:encoded><![CDATA[<p>You can access the Django request within a Template Tag by enabling the request context processor.</p>
<p>If you&#8217;re using a generic view, for example, &#8216;direct_to_template&#8217;, your render() function will then be passed a RequestContext , and you can access the request by context[&#8217;request&#8217;].</p>
<p>If you&#8217;re not using a generic view, and are using render_to_response(), then you have to explicitly pass context_instance=RequestContext(request) as the third parameter.</p>
<p>You enable the request context processor by adding this to your settings file:</p>
<p><code>TEMPLATE_CONTEXT_PROCESSORS =  ('django.core.context_processors.request',)</code></p>
<p>You might also need to add back the default context processors. These vary from version to version - check the django documentation for the settings file for details. </p>
<p>For example, in 0.96, I&#8217;ve got this in my settings file</p>
<p><code>TEMPLATE_CONTEXT_PROCESSORS = ('django.core.context_processors.request',<br />
                               'django.core.context_processors.auth',<br />
                               'django.core.context_processors.debug',<br />
                               'django.core.context_processors.i18n',<br />
                               )<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.willmer.com/kb/2008/06/how-to-access-the-django-request-inside-a-template-tag/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Learning Spanish</title>
		<link>http://www.willmer.com/kb/2008/06/learning-spanish/</link>
		<comments>http://www.willmer.com/kb/2008/06/learning-spanish/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 15:51:35 +0000</pubDate>
		<dc:creator>Rachel</dc:creator>
		
		<category><![CDATA[spanish]]></category>

		<guid isPermaLink="false">http://www.willmer.com/kb/2008/06/learning-spanish/</guid>
		<description><![CDATA[Just finished my first year of learning spanish. Here&#8217;s a page with links to various things I found useful: podcasts, TV shows, and books - Learning Spanish
]]></description>
			<content:encoded><![CDATA[<p>Just finished my first year of learning spanish. Here&#8217;s a page with links to various things I found useful: podcasts, TV shows, and books - <a href="http://www.willmer.com/kb/learning-spanish">Learning Spanish</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.willmer.com/kb/2008/06/learning-spanish/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Where can I buy a Wii Fit?</title>
		<link>http://www.willmer.com/kb/2008/05/where-can-i-buy-a-wii-fit/</link>
		<comments>http://www.willmer.com/kb/2008/05/where-can-i-buy-a-wii-fit/#comments</comments>
		<pubDate>Sat, 17 May 2008 15:53:43 +0000</pubDate>
		<dc:creator>Rachel</dc:creator>
		
		<category><![CDATA[my websites]]></category>

		<category><![CDATA[I like this]]></category>

		<guid isPermaLink="false">http://www.willmer.com/kb/2008/05/where-can-i-buy-a-wii-fit/</guid>
		<description><![CDATA[Trying to get a Wii Fit is almost impossibile - none of the shops have any in stock. Even Amazon has stocks only for a few minutes each time they get some before they&#8217;re all gone. Very frustrating! So one quiet evening, I wrote a real-time stock checker to tell me when they were in [...]]]></description>
			<content:encoded><![CDATA[<p>Trying to get a Wii Fit is almost impossibile - none of the shops have any in stock. Even Amazon has stocks only for a few minutes each time they get some before they&#8217;re all gone. Very frustrating! So one quiet evening, I wrote a real-time stock checker to tell me when they were in stock. 	</p>
<p>And now I&#8217;m the happy owner of a Wii Fit, and very excellent it is too&#8230;</p>
<p>And then I thought, hmm, that&#8217;s a good idea, so I bagged a domain name and here&#8217;s the website - <a href="http://www.whereforsale.com/wii_fit.html">Where Is It In Stock?</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.willmer.com/kb/2008/05/where-can-i-buy-a-wii-fit/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How Safe is Your Money?</title>
		<link>http://www.willmer.com/kb/2008/03/how-safe-is-your-money/</link>
		<comments>http://www.willmer.com/kb/2008/03/how-safe-is-your-money/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 17:57:33 +0000</pubDate>
		<dc:creator>Rachel</dc:creator>
		
		<category><![CDATA[my websites]]></category>

		<category><![CDATA[money]]></category>

		<guid isPermaLink="false">http://www.willmer.com/kb/2008/03/how-safe-is-your-money/</guid>
		<description><![CDATA[A new website I&#8217;ve been working on&#8230; http://www.howsafeisyourmoney.co.uk
]]></description>
			<content:encoded><![CDATA[<p>A new website I&#8217;ve been working on&#8230; <a href="http://www.howsafeisyourmoney.co.uk">http://www.howsafeisyourmoney.co.uk</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.willmer.com/kb/2008/03/how-safe-is-your-money/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
