What's Cooking!? http://cooking.visualspace.nl/ What's Cooking!? http://cooking.visualspace.nl/ http://asset.soup.io/asset/0198/1522_49cd.png 44 44 Django projects cooking at Visualspace . [dokterbob] (Image) <p><a href=""><img alt="8930_e44e_400" height="300" src="http://asset.soup.io/asset/0919/8930_e44e_400.png" width="400" /></a></p> <p></p>Sun, 11 Jul 2010 18:39:30 GMThttp://cooking.visualspace.nl/post/64808615/Imageurn:www-soup-io:1:64808615image [dokterbob] LESS <p>Less extends CSS with: variables, mixins, operations and nested rules.</p> <p><a href="http://lesscss.org/">http://lesscss.org/</a></p>Tue, 06 Jul 2010 19:30:02 GMThttp://cooking.visualspace.nl/post/63948223/LESSurn:www-soup-io:1:63948223link [dokterbob] (Video) <object height="350" width="425"><param name="movie" value="http://www.youtube.com/v/vYMpihXHobQ" /><param name="wmode" value="transparent" /><embed src="http://www.youtube.com/v/vYMpihXHobQ" wmode="transparent" type="application/x-shockwave-flash" height="350" width="425" /></object>Sat, 29 May 2010 13:17:33 GMThttp://cooking.visualspace.nl/post/58026459/Videourn:www-soup-io:1:58026459video [dokterbob] Introduction to Surlex <p>Surlex (Simple URL Expression) is a language for matching and extracting text, similar to regex (regular expression). It works by generating a regular expression from a more concise syntax that is designed to produce easy-to-read url patterns.</p> <p><a href="http://codysoyland.com/2009/sep/6/introduction-surlex/">http://codysoyland.com/2009/sep/6/introduction-surlex/</a></p>Tue, 13 Apr 2010 09:52:43 GMThttp://cooking.visualspace.nl/post/52904706/Introduction-to-Surlexurn:www-soup-io:1:52904706link [dokterbob] django-google-analytics - Project Hosting on Google Code <p>A simple django application that eases Google Analytics integration with your Django projects</p> <p><a href="http://code.google.com/p/django-google-analytics/">http://code.google.com/p/django-google-analytics/</a></p><p>[Reposted from <span class="user_container user174729" ><a class="" href="http://djangofeeds.soup.io/post/43268631/django-google-analytics-Project-Hosting-on-Google"><span class="name">djangofeeds</span></a></span>]</p>Tue, 02 Feb 2010 22:10:19 GMThttp://cooking.visualspace.nl/post/44142451/django-google-analytics-Project-Hosting-on-Googleurn:www-soup-io:1:44142451link [visualspace] ExtendibleAdmin class <p>A generic base class for extending ModelAdmin views. This can be used likewise: </p> <pre><code>def myview(self, request, object_id): obj = self._getobj(request, object_id) &lt; do something &gt; def get_urls(self): urls = super(MyAdmin, self).get_urls() my_urls = patterns('', url(r'^(.+)/myview/$', self._wrap(self.myview), name=self._view_name('myview')), ) return my_urls + urls </code></pre>Tue, 17 Nov 2009 06:46:47 GMThttp://cooking.visualspace.nl/post/34837541/ExtendibleAdmin-classurn:www-soup-io:1:34837541regular [visualspace] Remove named field from fieldsets <p>This snipped removes a specific field from the fieldsets. This is very useful to leave a field 'out' in the admin, likewise: </p> <pre><code>def get_fieldsets(self, request, obj=None): fieldsets = super(BlaModelAdmin, self).get_fieldsets(request, obj) if not request.user.has_perm('change_blah'): remove_from_fieldsets(fieldsets, 'blah') </code></pre>Tue, 17 Nov 2009 06:11:54 GMThttp://cooking.visualspace.nl/post/34837542/Remove-named-field-from-fieldsetsurn:www-soup-io:1:34837542regular [dokterbob] Git Repository Basics Guide <p><a href="http://wiki.sourcemage.org/Git_Guide">http://wiki.sourcemage.org/Git_Guide</a></p>Fri, 24 Jul 2009 14:23:50 GMThttp://cooking.visualspace.nl/post/23864729/Git-Repository-Basics-Guideurn:www-soup-io:1:23864729link [dokterbob] Setting up a new remote git repository <p>To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.</p> <p><a href="http://toolmantim.com/articles/setting_up_a_new_remote_git_repository">http://toolmantim.com/articles/setting_up_a_new_remote_git_repository</a></p>Fri, 24 Jul 2009 13:50:32 GMThttp://cooking.visualspace.nl/post/23862874/Setting-up-a-new-remote-git-repositoryurn:www-soup-io:1:23862874link [visualspace] Python Calendar wrapper template tag <p>This tag gives you an iterable Python <a href="http://docs.python.org/library/calendar.html">Calendar object</a> in your template namespace. It is used in the <a href="http://github.com/dokterbob/django-agenda">django-calendar</a> project. </p> <p>Use it as follows in your template: </p> <pre><code>{% get_calendar for &lt;month_number_or_variable&gt; &lt;year_or_variable&gt; as calendar %} &lt;table&gt; &lt;tr&gt; &lt;th&gt;Mon&lt;/th&gt; &lt;th&gt;Tue&lt;/th&gt; &lt;th&gt;Wed&lt;/th&gt; &lt;th&gt;Thu&lt;/th&gt; &lt;th&gt;Fri&lt;/th ...</code></pre>Tue, 05 May 2009 08:20:03 GMThttp://cooking.visualspace.nl/post/18536767/Python-Calendar-wrapper-template-tagurn:www-soup-io:1:18536767regular [visualspace] Soft hyphenation (­) template filter using PyHyphen <p>This template filter is meant to insert soft hyphens (<a href="http://www.cs.tut.fi/~jkorpela/shy.html">&amp;shy; entities</a>) in text whever it can. For this is relies on a <strong>recent</strong> checkout of the <a href="http://code.google.com/p/pyhyphen/">PyHyphen</a> interface to the hyphen-2.3 C library, which is also used by Mozilla and OpenOffice.org. </p> <p>It takes two optional parameters: the language ...</p>Thu, 16 Apr 2009 19:10:01 GMThttp://cooking.visualspace.nl/post/17398500/Soft-hyphenation-template-filter-using-PyHyphenurn:www-soup-io:1:17398500regular [dokterbob] Django Guestbook application <p>The other day I've written a pluggable guestbook application for Django. It is fully functioning and loosely based on the Django comments contrib. Currently, I am using it on a small website (<a href="http://www.hansenpaul120.nl/guestbook/">hansenpaul120.nl</a>, Dutch) but more websites are soon to follow.</p> <p>Current features: </p><ul> <li>Fully translatable (currently, only English and Dutch are available)</li> <li>Fully integrated with the admin</li> <li>Some barebone templates are supplied</li> </ul> <p>More features will be added as soon as I am going to use this in more sites, or when <b>you</b> do so. Some of these features may include: </p><ul> <li>(Better) documentation.</li> <li>Integration with <a href="http://docs.djangoproject.com/en/dev/ref/contrib/syndication/">Django syndication</a></li> <li>Integration with <a href="http://code.google.com/p/django-email-confirmation/">Django email confirmation</a></li> <li>Integration with <a href="http://docs.djangoproject.com/en/dev/topics/auth/">Django User authentication</a></li> </ul> <p>Installation should be pretty straight-forward for anyone who's installed a Django app before: </p><ol> <li>Get the source from <a href="http://github.com/dokterbob/django-guestbook/">GitHub</a> by either cloning or downloading the archive.</li> <li>Link the guestbook app into your project's tree:<br /> <pre>ln -s django-guestbook/guestbook guestbook</pre> </li> <li>Add the app to your <code>INSTALLED_APPS</code> in <code>settings.py</code>:<br /> <pre>INSTALLED_APPS = (<br /> ...<br /> 'django.contrib.admin',<br /> 'guestbook',<br />)</pre> </li><li>Add the guestbook app to your <code>urls.py</code>:<br /> <pre>urlpatterns = patterns('',<br /> ...<br /> (r'^guestbook/', include('guestbook.urls')), <br />)</pre> </li><li>Update the database structure:<br /> <pre>./manage.py syncdb</pre> </li> <li>You're done! Go and test your app by running:<br /> <pre>./manage.py runserver</pre> </li> </ol> <p>Feel free to provide feedback on the current state of the project, and perhaps on what features you might like. In any case, expect a more complete HOWTO here.</p> <p>The app's source code can be found <a href="http://github.com/dokterbob/django-guestbook/">here</a> on GitHub and the source for the hansenpaul120.nl website is <a href="http://github.com/dokterbob/hansenpaul/">here</a>. The latter might be a good place to see how the guestbook application can be used.</p>Tue, 23 Dec 2008 12:07:38 GMThttp://cooking.visualspace.nl/post/9992059/Django-Guestbook-applicationurn:www-soup-io:1:9992059regular [visualspace] Default to current/all sites in admin <p>This code sets the default sites for a sites ManyToMany property of a model to <code>Site.objects.all()</code>. This could easily be changed to <code>Site.objects.get_current()</code> to use the current site as default. </p> <p>Surely, we should be able to use <code>default=[Site.objects.get_current()</code> in the model <em>but</em> apparently ...</p>Sun, 12 Oct 2008 04:43:14 GMThttp://cooking.visualspace.nl/post/17390149/Default-to-current-all-sites-in-adminurn:www-soup-io:1:17390149regular