Code

Opened 8 years ago

Closed 7 years ago

#2268 closed defect (invalid)

generic views should call Manipulator.prepare()

Reported by: mir@… Owned by: jacob
Component: Generic views Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Within the FormField framework, Manipulators and FormFields have
a method prepare(). Its docstring says:

    def prepare(self, new_data):
        """
        Makes any necessary preparations to new_data, in place, before data has
        been validated.
        """

It would also be a nice place for this, but ... in reality, it never gets called.

If generic views called it before get_validation_errors (as the
docstring of prepare suggests), it would be a good place to add
logic for readonly fields (to replace them from original_object)

Furthermore, CheckboxSelectMultipleField overwrites prepare,
although it never gets called. I haven't used it, so can't say if
it's buggy.

Or am I missing something?

Attachments (0)

Change History (1)

comment:1 Changed 7 years ago by Gary Wilson <gary.wilson@…>

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

It does get called. Manipulator.get_validation_errors() calls self.prepare(new_data) and get_validation_errors() is called in the create and update generic views.

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.