Autogenerating forms from Doctrine models

Tags:

In a previous post I mentioned how Django’s model forms are awesome.

I really like the idea of being able to generate forms automatically from models – I mean the models already should contain most of the data you’d need: the fields, field types and how they will be stored.

Since I was already quite familiar with Doctrine’s internals, I knew it would be possible to find out all the data on the models quite easily, and set upon creating a class which generates Zend Framework’s Zend_Form based form classes from Doctrine models…

Edit 10.10.2008: Updated the post to reflect some minor changes in the CU_ModelForm class

Read More

The Opera Magazine

Tags:

Quiz: How many browsers have their own magazines?

Answer: One!

I recently received my paperback copy of the first issue of the Opera Magazine, Opera’s new lifestyle magazine.

I have mixed opinions about the first issue: while some parts were funny or interesting, the other parts were not, so I can’t decide whether I should say it’s really good or just good.

Nevertheless, you can get a PDF copy for free from the Opera community – it’s definitely worth checking out. Who wouldn’t want to know if you can fit Opera’s CEO in a Mini or whether they use real Vikings when making the browser and some other less interesting topics like saving the web? :D

Let’s see how they make a Firefox extension out of this ;)

Resource URLs and JavaScript

Tags:

Sometimes when working with JavaScript, you may need to refer some resource: Maybe a page or an image. They’re then used on the client-side code on your site.

But what happens if you restructure your project? Files move elsewhere… Maybe even domains change – you might be moving content to a specialized content hosting server for example. You would need to go through the JS files, check all of them for URLs and change them to the new correct ones.

Wouldn’t there be some solution that will make it easier in the event a change like that happens?

Read More

Improving Firefox usability

Tags:

Firefox is a good browser, but there are some small parts that have always bothered me when I use it.

  • Keyboard shortcuts – they don’t really work
  • Lack of mouse gestures out of the box
  • Weird tab behavior

These mostly come from the fact that I’m used to Opera, which does these things a little differently – and in my opinion, it does them better too. But hey, Firefox can be customized by adding plugins, so why don’t we do that and see if we can improve it!

Read More

Accessible and effective CAPTCHA

Tags:

I’ve visited the topic of different CAPTCHA methods for checking that the user sending data is a human being in a couple of occasions in the past.

There’s usually a slight problem with accessibility and ease of use in some methods – take the typical image-based CAPTCHA as an example: How would you use it with a text-only browser, or with images disabled on a mobile browser to save traffic?

I’ve previously mentioned using a form field with a simple question like “What color is the grass?”, which would work quite well. Now, there’s an interesting new kid called Figlet

Read More

Django = Awesome

Tags:

So in the lack of anything “useful” to post, and in the attemps to at least post something interesting, I shall dedicate this post to talking about what makes Django such an awesome framework!

I’m going to compare it to Zend Framework, as it’s the framework I’m most familiar with.

Read More

Is PHP a good first language?

Tags:

Sometimes I’ve seen people say PHP is a bad first language, because it teaches bad programming habits. But is this actually true at all? Often those who say that don’t really like PHP themselves either, many times because of equally untrue reasons.

I think PHP is a perfectly good first programming language – I would even go as far as say it’s possibly the ideal first language if you are interested in web development.

Read More

Django and Python

Tags:

I’ve thought it would be useful, both professionally and just for fun, to know a bit wider array of frameworks, libraries and other stuff related to web development, and last week it was Jaxer time. Now, I’ve got my hands on Django, a Python-based web framework.

I’ve always liked Python – The syntax is refreshingly different, and some of its features remind me of JavaScript’s good parts. In the past I used Python to write the server application for TankWar Online, the first ever (as far as I know) JavaScript-based game with online play capability.

Read More