<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Aurora Borealis</title>
    <description>The Northern Lights</description>
    <link>http://za.github.io/</link>
    <atom:link href="http://za.github.io/feed.xml" rel="self" type="application/rss+xml" />
    
      <item>
        <title>GitHub Secure Code Game</title>
        <description>&lt;p&gt;While randomly surfing the Internet, I found an interesting repo from GitHub.
It’s called &lt;a href=&quot;https://github.com/skills/secure-code-game&quot;&gt;Secure Code Game&lt;/a&gt;.
I have tried the first level from the first season. It’s quite interesting.
It was about &lt;em&gt;underflow&lt;/em&gt; bug. We’ve heard more about overflow.&lt;/p&gt;

&lt;p&gt;I’ll try fo find time to work on other levels.&lt;/p&gt;
</description>
        <pubDate>Thu, 19 Dec 2024 07:00:00 +0000</pubDate>
        <link>http://za.github.io/2024/12/19/github-secure-code-game/</link>
        <guid isPermaLink="true">http://za.github.io/2024/12/19/github-secure-code-game/</guid>
      </item>
    
      <item>
        <title>Multiple OS on WSL</title>
        <description>&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;How are you? How’s everything?&lt;/p&gt;

&lt;p&gt;I just want to post it here, that it turns out, we can have multiple OS on WSL.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;PS C:\ wsl --list --online
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Fri, 27 Sep 2024 07:00:00 +0000</pubDate>
        <link>http://za.github.io/2024/09/27/wsl-kali-linux/</link>
        <guid isPermaLink="true">http://za.github.io/2024/09/27/wsl-kali-linux/</guid>
      </item>
    
      <item>
        <title>Django Post Idea</title>
        <description>&lt;p&gt;Wow, it’s already 2019! And I just skipped 2018 without even a single post! For
this post, I just want to write short.&lt;/p&gt;

&lt;p&gt;So far, I have two ideas on writing a new post. They are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Migrating legacy Django hash password&lt;/li&gt;
  &lt;li&gt;Testing Django form with real data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s hope I can write this soon. See you!&lt;/p&gt;
</description>
        <pubDate>Tue, 22 Jan 2019 02:20:00 +0000</pubDate>
        <link>http://za.github.io/2019/01/22/django-post-idea/</link>
        <guid isPermaLink="true">http://za.github.io/2019/01/22/django-post-idea/</guid>
      </item>
    
      <item>
        <title>Improve Programmers Skill</title>
        <description>&lt;p&gt;Recently, I attended &lt;a href=&quot;https://pycon.my/2017/09/01/pycon-apac-2017-its-a-wrap/&quot;&gt;PyCon APAC 2017&lt;/a&gt;
which was held in Kuala Lumpur, Malaysia. It’s always nice to meet new people 
and share stories.&lt;/p&gt;

&lt;p&gt;It turned out, the most interesting talk for me was one of the session in lightning 
talk. It was delivered by Ivan.&lt;/p&gt;

&lt;p&gt;Ivan shared that programmers should always upgrade their skill and it can’t be 
done by working on our daily routine. We should take class, do some side 
projects, or even try some code contest.&lt;/p&gt;

&lt;p&gt;For example, solving a simple problem but only using the standard library. If 
most of the time we are requests library to make HTTP access, now try not to use 
requests library. Instead just use Python standard library.&lt;/p&gt;

&lt;p&gt;I definitely want to always upgrade my skill. I just have to find the time and 
the method that suits me. I found reading still important, but I guess problem 
solving still the best way to practice.&lt;/p&gt;
</description>
        <pubDate>Tue, 12 Sep 2017 15:20:00 +0000</pubDate>
        <link>http://za.github.io/2017/09/12/improve-programmers-skill/</link>
        <guid isPermaLink="true">http://za.github.io/2017/09/12/improve-programmers-skill/</guid>
      </item>
    
      <item>
        <title>Test Python/Django Script</title>
        <description>&lt;p&gt;Now I am thinking a better approach on testing Python/Django script. I have a
Python script which runs in a Django application. For example, this script will
send an email with how many new users registered in this week.&lt;/p&gt;

&lt;p&gt;So far, I use the manual approach, which requires me to have new user registered
within this week. I am not very satisfied with this approach, as the script is
getting complex, I need to manually prepare the data.&lt;/p&gt;

&lt;p&gt;Any idea?&lt;/p&gt;
</description>
        <pubDate>Mon, 27 Mar 2017 15:00:00 +0000</pubDate>
        <link>http://za.github.io/2017/03/27/testing-python-django-script/</link>
        <guid isPermaLink="true">http://za.github.io/2017/03/27/testing-python-django-script/</guid>
      </item>
    
      <item>
        <title>Fail Running Test Code</title>
        <description>&lt;p&gt;I was recalling, how did I run the test code. Until I found that I had written
the snippet. I copy-paste it… and the test code was fail. Something wrong. No
changes in the test code since my last commit.&lt;/p&gt;

&lt;p&gt;I tried the other test code. Looks OK. I tried to rename the fail test code
filename, still no good. So, what’s the problem?&lt;/p&gt;

&lt;p&gt;Until I found this &lt;a href=&quot;http://stackoverflow.com/questions/25575073/attributeerror-module-object-has-no-attribute-tests&quot;&gt;stackoverflow
question&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So, I tried to import the modules written in the test code via shell. Finally
now I know which part of the code that fails to import the library.&lt;/p&gt;
</description>
        <pubDate>Wed, 26 Oct 2016 16:56:24 +0000</pubDate>
        <link>http://za.github.io/2016/10/26/django-test-code/</link>
        <guid isPermaLink="true">http://za.github.io/2016/10/26/django-test-code/</guid>
      </item>
    
      <item>
        <title>MelbDjango Camp</title>
        <description>&lt;p&gt;It’s almost a month passed by from &lt;a href=&quot;https://melbdjango.camp/&quot;&gt;MelbDjango camp&lt;/a&gt;. 
I was planning to write a short review about it. So, let’s just give it a start. 
Better late than never.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://melbdjango.camp/static/images/MDjC.png&quot; alt=&quot;MelbDjango Camp&quot; /&gt;&lt;/p&gt;

&lt;p&gt;For me, Django community in Melbourne has been a very vibrant community. You 
name it! They have meetups, school, hack weekend and lastly the camp initiative. 
And I’ve learned a lot from the community.&lt;/p&gt;

&lt;p&gt;The camp lasted for two days and two nights. Basically we working on our own 
Django projects. And when you got stuck on something, there’s always someone who 
will help you.&lt;/p&gt;

&lt;p&gt;I was working on two Django projects. The first one, I was trying to visualize a 
Django app using d3.js Then the second one, I was trying to build a geographic 
information Django app. I also learned how to setup Django using PostgreSQL as 
the backend.&lt;/p&gt;

&lt;p&gt;Other than that, there were three workshops. The first one was Django-low down 
(Django slow down). We’re going through the Django docs and start creating a 
Django application from the scratch.&lt;/p&gt;

&lt;p&gt;The second was creating a vulnerable Django application. The reason was to 
prevent creating a vulnerable application by getting know what is a vulnerable 
Django application.&lt;/p&gt;

&lt;p&gt;And the last workshop was about Django template. What has Django template 
working for us, why Django template is slow, and so on.&lt;/p&gt;

&lt;p&gt;This camp was a great experience for me! I knew about redshift: an app that 
adjust your computer screen according to your position. At first I was surprised 
when I saw other’s monitor screen turning into red. Then I knew how to work 
on Django project tickets.&lt;/p&gt;
</description>
        <pubDate>Wed, 16 Dec 2015 16:56:24 +0000</pubDate>
        <link>http://za.github.io/2015/12/16/melbdjango-camp/</link>
        <guid isPermaLink="true">http://za.github.io/2015/12/16/melbdjango-camp/</guid>
      </item>
    
      <item>
        <title>Get Lost</title>
        <description>&lt;p&gt;Working with multiple monitors seem like a programmer’s heaven. Yes, it is. I 
like it. And now, I really enjoying my first vertical screen ever. Unfortunately 
I might only use this rotateable monitor this weeend.&lt;/p&gt;

&lt;p&gt;The difficult thing about working with multiple monitors (then multiple tabs) is 
finding which the tab that currently you need it. Sometimes I need to scroll 
each tab to find the right tab and move mouse pointer to other monitors.&lt;/p&gt;

&lt;p&gt;And the other &lt;em&gt;get lost&lt;/em&gt; thing is when english is not your native language. You 
might miss the context in a informal conversation since mostly I learn english 
in a formal context.&lt;/p&gt;

&lt;p&gt;I am a bit tired actually when writing this post. I’ve tried to get my Django 
app to return JSON value. Now I need to visualize this using d3.js In the 
morning, we had a djangolow-down by Mitch and we just finished OWASP Top 10 in 
Django by Brenton.&lt;/p&gt;

&lt;p&gt;Then when I tried to post a blog on my wordpress blog, the Internet was not 
working. So, I wrote this blog in a git post. Hopefully the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git push&lt;/code&gt; will 
work.&lt;/p&gt;
</description>
        <pubDate>Wed, 25 Nov 2015 19:04:24 +0000</pubDate>
        <link>http://za.github.io/2015/11/25/get-lost/</link>
        <guid isPermaLink="true">http://za.github.io/2015/11/25/get-lost/</guid>
      </item>
    
      <item>
        <title>Host Sphinx Documentation at GitHub Pages</title>
        <description>&lt;p&gt;Today I released a documentation to which we wrote using 
&lt;a href=&quot;http://sphinx-doc.org&quot;&gt;sphinx&lt;/a&gt; to &lt;a href=&quot;https://help.github.com/articles/creating-project-pages-manually/&quot;&gt;GitHub (project) 
pages&lt;/a&gt;. After 
did &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git push origin gh-pages&lt;/code&gt;, I saw the HTML is not pretty. Later, my friend 
found it was failed loading the CSS.&lt;/p&gt;

&lt;p&gt;So this is the solution. Add a 
&lt;a href=&quot;https://daler.github.io/sphinxdoc-test/includeme.html#add-a-nojekyll-file&quot;&gt;.nojekyll&lt;/a&gt;
file. And voila!&lt;/p&gt;

</description>
        <pubDate>Fri, 06 Nov 2015 07:17:24 +0000</pubDate>
        <link>http://za.github.io/2015/11/06/nojekyll-sphinx-gh-pages/</link>
        <guid isPermaLink="true">http://za.github.io/2015/11/06/nojekyll-sphinx-gh-pages/</guid>
      </item>
    
      <item>
        <title>Django Filter Query Exception</title>
        <description>&lt;p&gt;While looking for answers on this question: “Does multiple monitor increase
programmer’s productivity?”, I found interesting tips from
&lt;a href=&quot;http://www.joelonsoftware.com/articles/fog0000000043.html&quot;&gt;Joelon Software&lt;/a&gt;
blog post. It’s the fourth Joel’s Test: &lt;strong&gt;A Bug Database&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Since, I still don’t know yet what tool will help us to store our bugs, I’ll
write my &lt;em&gt;first&lt;/em&gt; bug in this blog post. And also I’d like to know how to write
snippet in Jekyll, which powered this blog.&lt;/p&gt;

&lt;p&gt;So, let’s give it a shot!&lt;/p&gt;

&lt;p&gt;Example, I am querying database using Django query filter.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;k&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;borrowed_books&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;borrow_date__lte&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;today&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; 
		&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;borrow_status&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;except&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DoesNotExist&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Http404&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;You&apos;re not borrowing any books&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;This code will not return the exception eventhough there is no match with the
filter rule. &lt;strong&gt;No match filter query will only return empty list&lt;/strong&gt;. So, I need to
fix the code.&lt;/p&gt;

&lt;p&gt;Let’s try to debug using the django shell.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;aurora.apps.users.models&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;User&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;u1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;borrower101@aurora.co&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;aurora.apps.books.models&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Book&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;borrowing&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;borrow_date__lte&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;today&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; 
		&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;u&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;borrow_status&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;u2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&apos;borrower102@aurora.co&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;borrowing&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;borrow_date__lte&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;today&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; 
		&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;u&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;borrow_status&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Dahl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Roald&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Griffith&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Andy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;So user u1 doesn’t borrow any books while u2 borrows 2 books. What to do to
improve this code? We could check the query length. If the query length equalas
to zero then we could throw the exception.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;span class=&quot;n&quot;&gt;borrowed_books&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Book&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;objects&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;filter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;borrow_date__lte&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;datetime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;today&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(),&lt;/span&gt; 
	&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;borrow_status&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;borrowed_books&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;		
	&lt;span class=&quot;k&quot;&gt;raise&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Http404&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;You&apos;re not borrowing any books&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;That’s all for now.&lt;/p&gt;

</description>
        <pubDate>Mon, 29 Jun 2015 11:44:20 +0000</pubDate>
        <link>http://za.github.io/2015/06/29/django-filter-query-exception/</link>
        <guid isPermaLink="true">http://za.github.io/2015/06/29/django-filter-query-exception/</guid>
      </item>
    
  </channel>
</rss>
