djangosnippets.org: Latest snippets posted by henninghttps://djangosnippets.org/users/henning/2010-06-01T05:37:53.972918-05:00henningMy approach on class based views
2010-06-01T05:37:53.972918-05:00henninghttps://djangosnippets.org/snippets/2046/<p>By using <strong>new</strong> the result of a class instantiation is not an object but the result of a method call.
This way classes can be used for views the same way as functions.
</p>
Freely redistributableSearch djangosnippets.org
2008-02-20T09:17:41.111005-06:00henninghttps://djangosnippets.org/snippets/608/<p>I was tired browsing via tag to find snippets I saw a while ago. So I created a custom search engine with Google. </p>
<p>To try it out go to <a href="http://henning.cco-ev.de/django/djangosnippets.html">http://henning.cco-ev.de/django/djangosnippets.html</a></p>
Freely redistributableCreate nice looking PDFs from developer documentation
2007-12-18T17:38:19.616905-06:00henninghttps://djangosnippets.org/snippets/516/<p>You need htmldoc, rst2html, the Python Imaging Libraray, BeautfiulSoup
and spoon.
The Debian/Ubuntu-packages are called htmldoc, python-docutils, python-imaging and python-beautifulsoup
You can get spoon.py http://beautifulspoon.googlecode.com/svn/trunk/spoon.py</p>
<p>To create the pdf files you have to call the script from django_src/docs</p>
<p>Here is an example output: http://henning.cco-ev.de/django/essential.pdf</p>
Freely redistributablebrowscap.ini-parser
2007-06-06T08:58:46.690821-05:00henninghttps://djangosnippets.org/snippets/267/<p>Sometimes you need to know if a visitor is a bot or if the browser supports certain features or if it is a mobile device.</p>
<p>The easiest way to do so would be to lookup the user agent in a capabilities database.
Fortunately there is already such a database called …</p>
Freely redistributableQuick and dirty way to make dynamically available all tables of a database as models
2007-05-27T12:12:55.807528-05:00henninghttps://djangosnippets.org/snippets/256/<p>There are a lot of reasons why you should not do this.
But nevertheless it might be useful in certain situations.</p>
<p>If your database does not change and you want to use validators etc you better use inspectdb from django-admin.py</p>
Freely redistributable