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
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
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 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
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
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 ...
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
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
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,
>
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
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
11 matches
Mail list logo