Posts

Showing posts with the label newforms

Thoughts on Django

What follows are some thoughts on django written by Isaac Alston, a friend of mine from university. He originally wrote it as a facebook note, but after reading it I asked if I could re-post it here. I think he gives an enlightening point of view on the experience of a python newcomer beginning to use django . Here it is: This is a short review of my experience with Django ( http://www.djangoproject.c om ). Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. In November, I was informed that the company I am working for would be leaving PHP behind. We had been looking for a faster, and cleaner development tool for a while and were deciding between Ruby on Rails ( http://www.rubyonrails.org/ ) and Django. I had a preference for Django immediately, since I could already program in Python, whereas Rails required Ruby skills. After much debate and discussion, my company eventually chose to use Rails. My co-worker, flatmate and (dare...

django newforms for models

The way django does forms is in a state of transition. There's the old (or, depending on your point of view, current) way, manipulators , and the new way, newforms . newforms is only available in the svn version of django at present, and is still incomplete. Despite this, newforms is usable and provides several compelling advantages over the old way. The docs at present are a little thin (although improving quickly), but the unit tests are full of useful examples (the stuff towards the end is the most interesting, and shows off some of the flexibility of newforms). One thing that would be nice, though, is a way of easily creating a form class that uses a model class's fields. If we have this, we can avoid needless and tedious repetition. Django recently got a function that can be used for this, newforms.form_for_model. It's a start, but there are a few things I'd like it to do that it currently can't. I'd like to use the model's specified defaults, if any, ...