Opened 19 years ago
Closed 19 years ago
#2586 closed enhancement (fixed)
New Manipulators Proposal
| Reported by: | brantley | Owned by: | Adrian Holovaty |
|---|---|---|---|
| Component: | Metasystem | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Triage Stage: | Design decision needed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I have built a proposal for a new Manipulator system, which solves what I consider to be a long-standing problem in Django. Here are some of the benefits of this new system:
- Custom form views become very simple, and intuitive.
- Validation aware models are harnessed.
- Forms are raised as an exception. This allows the writer to assume the data is correct the whole way through. However, when there is a validation exception, it is handled easily.
The full proposal can be found here:
http://code.djangoproject.com/wiki/NewManipulators
Here is a sample view using a default Create-Manipulator:
def create_poll(request): try: m = Poll.CreateManipulator() poll = m.process(request) return HttpResponseRedirect('/poll/%d/' % poll.id) except Form, form: return render_to_response('poll/create.html', {'form': form})
Feedback and criticism would be greatly appreciated.
Change History (2)
comment:1 by , 19 years ago
| Triage Stage: | Unreviewed → Design decision needed |
|---|
comment:2 by , 19 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
This essentially *is* newforms, so we can mark it as fixed.
Note:
See TracTickets
for help on using tickets.
Is this still an issue given the newforms framework?