Malcolm Tredinnick wrote: >>I have some CharField's in my model, I'm using create_update generic >>views to edit them. I need all text data to be strip()'ed before being >>saved to database. How can this be done in the most simple way? >> >> > >In the model's save() method. > > Hmm, is there any way to do it before validation?
If I send the user back to the form to correct some data, I'd like him to see already stripped data. For the moment I use my custom 'generic view' instead of create_update, and I'm passing optional 'preprocess_callable' to it if I want to do anything like that. But I consider it a hack, it's far from being clean solution. >Not really; that is one of the points at which you should be thinking of >writing your own views. Fortunately the problem will soon (for trunk >users; in 1.0 for released version users) be moot as generic views are >moved to use newforms rather than oldforms/manipulators. > > That's what I did - I have my own (very simple) generic editor view. How is this supposed to be done with newforms? BR, Przemyslaw --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---