Code

Opened 8 years ago

Closed 7 years ago

#2586 closed enhancement (fixed)

New Manipulators Proposal

Reported by: brantley Owned by: adrian
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: UI/UX:

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.

Attachments (0)

Change History (2)

comment:1 Changed 7 years ago by Simon G. <dev@…>

  • Triage Stage changed from Unreviewed to Design decision needed

Is this still an issue given the newforms framework?

comment:2 Changed 7 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

This essentially *is* newforms, so we can mark it as fixed.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.