#2535: [patch] Manipulator-aware admin validators are impossible
-------------------------------------------+--------------------------------
Reporter: Tom Tobin <[EMAIL PROTECTED]> | Owner: adrian
Type: defect | Status: new
Priority: normal | Milestone:
Component: Validators | Version:
Severity: normal | Keywords:
-------------------------------------------+--------------------------------
Since magic-removal was merged, there has been no straightforward way to
create a validator with the manipulator available to it (see
[http://groups.google.com/group/django-users/msg/a76be4c94631ec80 this
post on django-users] for an example of how it might be done).
Furthermore, it has been outright impossible to create such a validator
for use in the admin; such validators were possible in pre-MR by prefixing
the validator name with `manipulator_validate`.
The attached patch aims to restore such functionality by means of a
simple, backwards-compatible API change: if the validator takes three
arguments, rather than the standard two (i.e., `field_data` and
`all_data`), the manipulator will be passed in as the first argument. The
patch uses currying to accomplish this, and accounts for all the various
types of callables that might be used (methods, callable class instances,
etc.).
--
Ticket URL: <http://code.djangoproject.com/ticket/2535>
Django <http://code.djangoproject.org/>
The web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates
-~----------~----~----~----~------~----~------~--~---