Ticket #4363: preview.diff
File preview.diff, 1.1 KB (added by , 17 years ago) |
---|
-
django/contrib/formtools/preview.py
91 91 92 92 def preview_get(self, request): 93 93 "Displays the form" 94 f = self.form(auto_id=AUTO_ID )94 f = self.form(auto_id=AUTO_ID, initial=self.initial(request)) 95 95 return render_to_response(self.form_template, 96 96 {'form': f, 'stage_field': self.unused_name('stage'), 'state': self.state}, 97 97 context_instance=RequestContext(request)) … … 121 121 122 122 # METHODS SUBCLASSES MIGHT OVERRIDE IF APPROPRIATE ######################## 123 123 124 def initial(self, request): 125 """ 126 Returns dynamic initial values for the given Form instance. 127 128 The return value should be a dictionary mapping field names to 129 initial values. 130 """ 131 return None 132 124 133 def parse_params(self, *args, **kwargs): 125 134 """ 126 135 Given captured args and kwargs from the URLconf, saves something in