• jQuery: Novice to Ninja — what I’ve found useful

    Июнь 26, 2010

    Recently I’ve read a book  jQuery: Novice to Ninja. I was using jQuery for a long time, however I felt that I was using only a small part of this library, so I decided to read some books about it. The books is rather good and easy (and interesting) to read. Here I want to […]

  • Auto trimming field value / Django forms

    Июнь 7, 2010

    I don’t know why this is not done by default, but.. from django import forms class TrimmedCharField(forms.CharField): def clean(self, value): return forms.CharField.clean(self, value.strip()) class Form1(forms.Form): f1 = TrimmedCharField(widget=forms.Textarea(attrs={‘rows’: 6})) f2= TrimmedCharField(widget=forms.Textarea(attrs={‘rows’: 6}))

  • django registration form custom field

    Июнь 1, 2010

    In most cases when a user registers in your django application you need to know more than just user name, password and e-mail. To add custom fields to the registration form you should pass form_class parameter to the register view function — it’s easy, but saving additional data could be rather complex. There are solutions […]

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org