<?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>Skylab Blog</title>
	<atom:link href="http://blog.philippmetzler.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.philippmetzler.com</link>
	<description>Skylab company blog - our solutions and problems</description>
	<lastBuildDate>Tue, 28 Feb 2012 17:31:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Ajax foreign key filter in Django admin interface</title>
		<link>http://blog.philippmetzler.com/?p=52</link>
		<comments>http://blog.philippmetzler.com/?p=52#comments</comments>
		<pubDate>Tue, 13 Apr 2010 17:27:15 +0000</pubDate>
		<dc:creator>googol</dc:creator>
				<category><![CDATA[Django]]></category>

		<guid isPermaLink="false">http://blog.philippmetzler.com/?p=52</guid>
		<description><![CDATA[We have a solution to the problem now! So first the solution and then the problem: http://github.com/digi604/django-smart-selects The problem: http://code.google.com/p/django-ajax-filtered-fields/ Just tried django-ajax-filtered-fields and like it very much. I&#8217;m looking for a solution for this problem: My model looks like this: class Artist(models.Model): class Song(models.Model): artist = models.ForeignKey(Artist) album = models.ForeignKey(Album, blank=True, null=True) class Album(models.Model): [...]]]></description>
			<content:encoded><![CDATA[<p><strong>We have a solution to the problem now!</strong> So first the solution and then the problem:</p>
<p><a href="http://github.com/digi604/django-smart-selects" target="_blank">http://github.com/digi604/django-smart-selects</a></p>
<p>The problem:</p>
<p><a href="http://blog.philippmetzler.com/wp-content/uploads/2010/04/filter.png"><a href="http://blog.philippmetzler.com/?p=52" rel="bookmark" class="imagelink" title="Permanent Link to Ajax foreign key filter in Django admin interface"><img class="alignnone size-full wp-image-67" title="filter" src="http://blog.philippmetzler.com/wp-content/uploads/2010/04/filter.png" alt="" width="510" height="110" /></a></a></p>
<p><a href="http://code.google.com/p/django-ajax-filtered-fields/" target="_blank">http://code.google.com/p/django-ajax-filtered-fields/</a></p>
<p>Just tried django-ajax-filtered-fields and like it very much. I&#8217;m looking for a solution for this problem:</p>
<p>My model looks like this:</p>
<pre>class Artist(models.Model):

class Song(models.Model):
    artist = models.ForeignKey(Artist)
    album = models.ForeignKey(Album, blank=True, null=True)</pre>
<pre>class Album(models.Model):
    artist = models.ForeignKey(Artist)</pre>
<p>So the user has to define an an artist when adding a song. He can also define an album but doesn&#8217;t have to. The album belongs to an artist.</p>
<p><strong>In the Django admin interface</strong> I&#8217;d like to limit the choices for albums based upon what he selects in the field &#8220;artist&#8221;. That should change dynamically with AJAX. I will have a closer look to django-ajax-filtered-fields but didn&#8217;t find a solution to that specific problem. Are there plans to include such functionality in the Django admin interface?</p>
<p>The ajax filter should work with more than two levels also. For instance if there is an additional class like</p>
<pre>class RecordLabel(models.Model):
    artist = models.ForeignKey(Artist)</pre>
<p>So if i select a record label the choices for artist should be filtered based upon the selected record label the artist is signed to.</p>
<p>Perhaps it&#8217;s another usecase for django-ajax-filtered-fields in general? Or do you know another solution to my specific requirements?</p>
<p>Discussion in the Django developers group: <a href="http://groups.google.com/group/django-developers/browse_thread/thread/daa3bcdfa247c2ed" target="_blank">http://groups.google.com/group/django-developers/browse_thread/thread/daa3bcdfa247c2ed</a></p>
<hr /><a href="http://github.com/alex/django-filter" target="_blank">http://github.com/alex/django-filter</a><br />
Django-filter is a reusable Django application for allowing users to filter queryset dynamically. But it seems not to be suitable for the admin interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.philippmetzler.com/?feed=rss2&#038;p=52</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add a collection / product overview page to a Shopify shop</title>
		<link>http://blog.philippmetzler.com/?p=20</link>
		<comments>http://blog.philippmetzler.com/?p=20#comments</comments>
		<pubDate>Tue, 13 Apr 2010 16:38:04 +0000</pubDate>
		<dc:creator>googol</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.philippmetzler.com/?p=20</guid>
		<description><![CDATA[Example: http://gastrotech.myshopify.com/collections Taking control of the collections listing page: http://wiki.shopify.com/Taking_control_of_the_collections_listing_page Shopify Theme Guide: http://wiki.shopify.com/The_Shopify_Theme_Guide Use this template: &#60;div id="collections-listing"&#62; {% if collections.present? %} &#60;h2&#62;Kategorien&#60;/h2&#62; {% for collection in collections %} &#60;a href="{{collection.url}}"&#62; &#60;div&#62; {% for temp in collection.all_products limit: 1 %} &#60;div&#62; &#60;img src="{{ temp.images.first &#124; product_img_url: 'small' }}" /&#62; &#60;/div&#62; {% endfor %} &#60;div&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Example:<a href="http://gastrotech.myshopify.com/collections" target="_blank"> http://gastrotech.myshopify.com/collections</a></p>
<p><a href="http://blog.philippmetzler.com/wp-content/uploads/2010/04/Bild-2.png"><a href="http://blog.philippmetzler.com/?p=20" rel="bookmark" class="imagelink" title="Permanent Link to Add a collection / product overview page to a Shopify shop"><img class="alignnone size-full wp-image-21" title="shopify collection overview" src="http://blog.philippmetzler.com/wp-content/uploads/2010/04/Bild-2.png" alt="" width="421" height="201" /></a></a></p>
<p>Taking control of the collections listing page: <a href="http://wiki.shopify.com/Taking_control_of_the_collections_listing_page" target="_blank">http://wiki.shopify.com/Taking_control_of_the_collections_listing_page</a></p>
<p>Shopify Theme Guide: <a href="http://wiki.shopify.com/The_Shopify_Theme_Guide" target="_blank">http://wiki.shopify.com/The_Shopify_Theme_Guide</a></p>
<p>Use this template:</p>
<pre>&lt;div id="collections-listing"&gt;
   {% if collections.present? %}
   &lt;h2&gt;Kategorien&lt;/h2&gt;

   {% for collection in collections %}
   &lt;a href="{{collection.url}}"&gt;
   &lt;div&gt;

       {% for temp in collection.all_products limit: 1 %}
       &lt;div&gt;
           &lt;img src="{{ temp.images.first | product_img_url: 'small' }}" /&gt;
       &lt;/div&gt;
       {% endfor %}

       &lt;div&gt;
           &lt;div&gt;{{ collection.title }}&lt;/div&gt;
           &lt;small&gt;{{ collection.products_count }} Artikel&lt;/small&gt;
       &lt;/div&gt;

    &lt;/div&gt;
    &lt;/a&gt;
    {% endfor %}

    {% else %}

    &lt;p&gt;Keine Kategorien gefunden...&lt;/p&gt;

    {% endif %}
&lt;/div&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.philippmetzler.com/?feed=rss2&#038;p=20</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Colorize git messages</title>
		<link>http://blog.philippmetzler.com/?p=15</link>
		<comments>http://blog.philippmetzler.com/?p=15#comments</comments>
		<pubDate>Tue, 13 Apr 2010 16:28:11 +0000</pubDate>
		<dc:creator>googol</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.philippmetzler.com/?p=15</guid>
		<description><![CDATA[error: git-checkout-index: unable to create file public/media/uploads/pdf/dummy1.pdf (Permission denied) error: git-checkout-index: unable to create file public/media/uploads/pdf/dummy2.pdf (Permission denied) fatal: merging of trees 78c30151ebcf0866a8bb0b0ad82dc9cf9e0b697a and 7cf25a39a86b53564eed4b9c11b281033693c1e5 failed Merge with strategy recursive failed. In order to colorize the error messages (red please) of git you can edit your ~/.bash_profile HIGHLIGHT=`echo -e &#8216;\033[31m\033[1m'` NORMAL=`echo -e '\033[0m'` alias gpull="git [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000; font-weight: bold;"><br />
error: git-checkout-index: unable to create file public/media/uploads/pdf/dummy1.pdf (Permission denied)<br />
error: git-checkout-index: unable to create file public/media/uploads/pdf/dummy2.pdf (Permission denied)<br />
fatal: merging of trees 78c30151ebcf0866a8bb0b0ad82dc9cf9e0b697a and 7cf25a39a86b53564eed4b9c11b281033693c1e5 failed<br />
Merge with strategy recursive failed.<br />
</span></p>
<p>In order to colorize the error messages (<span style="color: #ff0000; font-weight: bold;">red</span> please) of git you can edit your ~/.bash_profile</p>
<p>HIGHLIGHT=`echo -e &#8216;\033[31m\033[1m'`<br />
NORMAL=`echo -e '\033[0m'`<br />
alias gpull="git pull 2&gt;&amp;1 | sed -E -e 's/error:|warning:|fatal:/$HIGHLIGHT&amp;/'; echo $NORMAL; ./manage.py collectstatic --noinput; ./manage.py syncdb; ./manage.py migrate --list; echo '*** git pull: DONE *** collect static: DONE *** syncdb: DONE *** migrations available? *** apply migrations manually!'"<br />
alias gpush="git push 2&gt;&amp;1 | sed -E -e 's/error:|warning:|fatal:/$HIGHLIGHT&amp;/'; echo $NORMAL; maintenance/update_server.sh"<br />
# alias gcomm="git commit -a; maintenance/utest.py"<br />
alias gcomm="git commit -a;"<br />
alias dumpd="./manage.py dumpdata &gt;fixtures/all.json --indent 4"<br />
alias loadd="./manage.py loaddata fixtures/all.json"<br />
alias runserver="./manage.py runserver_plus"<br />
alias shell="./manage.py shell_plus"<br />
#alias syncdb="./manage.py syncdb --verbosity 2"<br />
alias syncdb="./manage.py syncdb"<br />
alias dbinit="./dbinit.py"<br />
alias editmsgs="nano locale/de/LC_MESSAGES/django.po"<br />
alias makemsgs="django-admin.py makemessages -a --verbosity=2"<br />
alias compilemsgs="django-admin.py compilemessages"<br />
alias clearthumbs="./manage.py thumbnail cleanup; ./manage.py thumbnail clear; echo 'Server neu starten damit die Thumbnails neu erzeugt werden!'"</p>
<p>#alias unittest="./manage.py test"<br />
# Das jeweilige Projekt definiert was genau getestet werden soll:<br />
alias unittest="./utest.py"</p>
<hr />
<p>git itself also supports colors - e.g. for files that are not yet added to the repository. edit .git/config like this:</p>
<p>[color]<br />
branch = always<br />
diff = always<br />
grep = always<br />
interactive = always<br />
pager = true<br />
showbranch = auto<br />
status = auto<br />
ui = always</p>
<p>[color "interactive"]<br />
error = red bold</p>
<p>[color "branch"]<br />
current = yellow reverse<br />
local = yellow<br />
remote = green</p>
<p>[color "diff"]<br />
meta = yellow bold<br />
frag = magenta bold<br />
old = red bold<br />
new = green bold</p>
<p>[color "status"]<br />
added = yellow<br />
changed = green</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.philippmetzler.com/?feed=rss2&#038;p=15</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

