September 26, 2006 at 12:03 pm
by Wolfram · Filed under Computers, Miscellaneous, Programming
Actually I do only want to know about objects in my application, I don’t really need a relational database in the common sense below my application. It’s just one more level where data have to be mapped to something unnatural. So why should I not start looking a bit closer into real object storage, like db4objects does it. I will have to take the time, may be I can cut another unnecessary layer of complexity from my application.
The technology is always making us take a detour, simply because it is not really a human thing to use. How human is it to communicate with each other by converting our interaction signals (voice, gestures, …) into digital streams of multiple zeros and ones. This is so awkward and simply feels unnatural. The same applies to writing web applications.
First we are limited by the capabilities of the browser. Then we have to support all the browsers, that in turn again implement the same technology in different ways. Beyond the browser we have to communicate over a dumb protocol, which does not allow for real interaction and actually makes us covert our data in a way so that we can send them over the protocol. Next and probably the worst of all, is we are trying to use those data in a way that has a completely different way of modeling the data then the actual usage case does it. Wouldn’t it be ideal to auto-determine what and how to persist data, states and combinations of them by “scraping” the user interface that is created for the user? Why do we have to map the user interface first to some low-end technology, some markup, later convert it into data streams, use it with objects and finally persist it in a completely different final format, in a database. Oh man, this seems soo much overhead and error-prone. But I am getting too philosophical. Back to work …
Permalink
September 25, 2006 at 11:46 am
by Wolfram · Filed under Django, Programming, Python
Permalink
September 23, 2006 at 5:27 pm
by Wolfram · Filed under Django, Programming, Python
This article generally discusses Django’s template syntax and in detail offers a patch for the existing tag ifchanged. The patch allows to pass a parameter to ifchanged, which is then evaluated and checked if it has changed, instead of the tag’s content. If it has changed the content is being printed, as usual. I.e. you can do
{% ifchanged variable %}print if variable's value has changed{% ifchanged %}
You can download the patch here, the Django-ticket is here. To know more about the details, read on.
Read the rest of this entry »
Permalink
September 21, 2006 at 10:25 pm
by Wolfram · Filed under Computers, Miscellaneous, Programming
I just came across those three very interesting articles (they are linked one among another, so finding them was easy :-)). Since I am building a new web app I have to think about the following things. And I have to do it better than I thought before I read those articles.
The well-known article Cool URIs don’t change from Tim Berners-Lee.
URL as UI is also about URI design, it contains a couple more practical tips and some reasoning that I should really consider when creating my URIs like: easy to type, all one case, hackable, no longer than 78 characters, etc…
And I should read this one about Usability of Confirmation Email and Transactional Messages, it just costs a US$100.
Permalink
September 21, 2006 at 12:10 pm
by Wolfram · Filed under Programming, Python
Quite a long list of all kinds of testing tools for Python, and not only for unit testing. That looks very interesting, I will need to spend some time on that.
Found via jotsite.com.
Permalink
September 21, 2006 at 12:31 am
by Wolfram · Filed under Django, Programming, Python
How often was I hitting TAB to get completion for so many things. When I discovered in the Django docs that it has bash completion for all the Django managment commands I just had to activate them right that seconds. Great! Thats another little step to a better working environment.
* Type django-admin.py.
* Press [TAB] to see all available options.
* Type sql, then [TAB], to see all available options whose names start with sql.
You can find the file you need to install inside “extras/django_bash_completion”. It contains the following instructions how to get it working in your bash:
# Installing
# ==========
#
# To install this, point to this file from your .bash_profile, like so:
#
# . ~/path/to/django_bash_completion
#
# Do the same in your .bashrc if .bashrc doesn’t invoke .bash_profile.
#
# Settings will take effect the next time you log in.
Permalink
September 17, 2006 at 1:54 pm
by Wolfram · Filed under Programming, Python
Lately I am doing a lot of Python again. Especially Django and I have to say I am starting to be productive with it. I was first fighting with the support of DB-views and other features MySQL 5 has finally bundled, but a couple fixes got me around. More about that in a later article.
While writing a couple of tests (btw still using testOOB) I needed to do some date and time calculation. I just wanted to update a timestamp in the DB and compare the delta. While I was thinking about how to do it, it popped to my mind, that I am probably thinking too complicated. So let’s try the obvious one.
>>> from datetime import datetime
>>> now = datetime.now()
>>> now - 1
Traceback (most recent call last):
File "< stdin>“, line 1, in ?
TypeError: unsupported operand type(s) for -: ‘datetime.datetime’ and ‘int’
Read the rest of this entry »
Permalink