Opened 18 years ago
Closed 17 years ago
#2535 closed defect (invalid)
[patch] Manipulator-aware admin validators are impossible
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Validators | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Since magic-removal was merged, there has been no straightforward way to create a validator with the manipulator available to it (see 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.).
Attachments (1)
Change History (4)
by , 18 years ago
Attachment: | manipulator_validators.diff added |
---|
comment:1 by , 18 years ago
priority: | normal → low |
---|
Decreasing the priority on this one for now. Since the Great Manipulator Redesign project seems to be gathering steam again on the developers' list, this patch should be unnecessary.
comment:2 by , 17 years ago
Reporter: | changed from | to
---|
comment:3 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Closing this because manipulators have been replaced with the newforms library.
Implements manipulator-aware validators in post-MR.