Category: django

How to create a PyDev project with DJango and Google App Engine support

Posted by – December 13, 2011

PyDev is an awesome plugin for Python development under Eclipse, with this plugin you can easily create a Django project or a Google App Engine project, but not a project which uses Django and run under Google App Engine at same time.

Here’s what I did to create a project which has support for both features:
More

Share

Fixing date input in Django

Posted by – February 18, 2009

There’s no doubt about Django and its agile development nature, but there are some circustances where we need take more care on user input, one of these circustances is date input, after few hours googling about it I finally found a way to fix date input by just using DateTimeInput widget on DateField of Django ModelForm.

More

Share

Changing field widget attributes from view code

Posted by – February 3, 2009

Yesterday I finally wrote my first Django application, this application is a basic crud that contains two pages, one to list costumers and another to change costumer data.

My biggest challenge was related with some form features, with Django forms you can programatically create a view form that contains several fields with its constraints and optionally associate a Django widget with this field. Django forms also have a very powerful validation engine and some form field constraints must be defined for this purpose.

This application uses the same page for two purposes, to add new data or edit data, in this scenario I must use a hidden field to be used as flag indicating in which mode the page is, adding or editing data, I must also change the readonly attribute of input widget used by costumer id form field since the user can’t change costumer id.
More

Share