Re: Custom Manipulators

2006-06-20 Thread Adrian Holovaty
On 6/14/06, Brantley Harris <[EMAIL PROTECTED]> wrote: > > Yeah, refactoring Manipulators is one of the last things I want to > > have happen before Django goes 1.0. > Mind if I take a shot at it? Sure, proposals are definitely welcome. Adrian -- Adrian Holovaty holovaty.com | djangoproject.co

Re: Custom Manipulators

2006-06-14 Thread Brantley Harris
Mind if I take a shot at it? On 6/14/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 6/13/06, Brantley Harris <[EMAIL PROTECTED]> wrote: > > Custom manipulators are a pain. Could we think about integrating this > > cookbook recipie into Django? Or a

Re: Custom Manipulators

2006-06-14 Thread Adrian Holovaty
On 6/13/06, Brantley Harris <[EMAIL PROTECTED]> wrote: > Custom manipulators are a pain. Could we think about integrating this > cookbook recipie into Django? Or at least start a dialogue about > improving this process. > > http://code.djangoproject.com/wiki/CookBookManipul

Custom Manipulators

2006-06-13 Thread Brantley Harris
Custom manipulators are a pain. Could we think about integrating this cookbook recipie into Django? Or at least start a dialogue about improving this process. http://code.djangoproject.com/wiki/CookBookManipulatorCustomManipulator --~--~-~--~~~---~--~~ You

Re: Custom manipulators

2006-05-30 Thread Luke Plant
Ivan Sagalaev wrote: > Luke Plant wrote: > > >Manipulator.get_validation_errors() ignores the 'follow' parameter, so > >you get validation errors for fields that aren't included. > > > Just tested it and it shows that you don't. I have a required field > switched off with "follow" that is not in

Re: Custom manipulators

2006-05-30 Thread Michael Radziej
Luke Plant wrote: > Also, 'follow' is sub-optimal -- you have to calculate (either by hand > or automatically) the fields that you want to *exclude*, rather than > pass in simply the ones you want to include. Maybe some utility > function on AutomaticManipulator might help. Here's my version ...

Re: Custom manipulators

2006-05-30 Thread Ivan Sagalaev
Luke Plant wrote: >Manipulator.get_validation_errors() ignores the 'follow' parameter, so >you get validation errors for fields that aren't included. > Just tested it and it shows that you don't. I have a required field switched off with "follow" that is not in the form. It doesn't give an erro

Re: Custom manipulators

2006-05-30 Thread Luke Plant
Luke Plant wrote: > However, I had > problems. But I've forgotten what they were now I remembered what my problem was: Manipulator.get_validation_errors() ignores the 'follow' parameter, so you get validation errors for fields that aren't included. Also, it's not simple to strip them out, sin

Re: Custom manipulators

2006-05-30 Thread Luke Plant
Ivan Sagalaev wrote: > You are looking for undocumented "follow": > > class MyManipulator(MyModel.ChangeManipulator): > def __init__(self, id): > MyModel.ChangeManipulator.__init__(self, id, follow={ > 'my_text_field': False, > 'my_date_field': False, >

Re: Custom manipulators

2006-05-29 Thread Ivan Sagalaev
Luke Plant wrote: >Has anyone tried to use Django's manipulators and forms for the case >where you only want a few fields to be editable, and the rest to keep >the original values? > I'm doing it very often. I have some frankenstein user model which is editable partly in one form, partly in an

Custom manipulators

2006-05-29 Thread Luke Plant
this internally, which becomes pretty complicated with DateTimeFields etc). The other main method is custom manipulators with only a few fields. This sucks because it violates DRY - you have to tell the custom manipulator the information that AutomaticManipulators deduce automatically from the m