Actually no :-( It will conflict with keys, clear etc members of standard dictionary. May be I will write a MyForm that will do it locally for me, from which I will inherit the rest of my forms.
On 3/7/07, Amit Upadhyay <[EMAIL PROTECTED]> wrote: > > Hi, > > I have an enhancement request for new forms, instead of doing > > def save(self): > > Blog.objects.create(title=self.clean_data["title"], description= > > self.clean_data["description"] ) > > > > and > > def __init__(self, blog, *args, **kw): > > super(MyForm, self).__init__(*args, **kw) > > self.fields["title"].initial = blog.title > > > > It would be better to use: > > def save(self): > > Blog.objects.create(title=self.clean_data.title, description= > > self.clean_data.description) > > > > and > > def __init__(self, blog, *args, **kw): > > super(MyForm, self).__init__(*args, **kw) > > self.fields.title.initial = blog.title > > > > Its easier on eyes as well as fingers. > > Please! I love you, I beg you! :-) > > -- > Amit Upadhyay > +91-9820-295-512 -- Amit Upadhyay Blog: http://www.rootshell.be/~upadhyay +91-9820-295-512 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
