Opened 18 years ago

Closed 18 years ago

#2268 closed defect (invalid)

generic views should call Manipulator.prepare()

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

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?

Change History (1)

comment:1 by Gary Wilson <gary.wilson@…>, 18 years ago

Resolution: invalid
Status: newclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top