Example #1
0
    def get_initial(self):
        initial = FormView.get_initial(self)

        for field_name in ['title', 'content']:
            session_key = 'unsaved_article_%s_%d' % (field_name,
                                                     self.article.id)
            if session_key in self.request.session:
                content = self.request.session[session_key]
                initial[field_name] = content
                del self.request.session[session_key]
        return initial
Example #2
0
 def get_initial(self):
     initial = FormView.get_initial(self)
     initial["name"] = self.kwargs["pk"]
     return initial
Example #3
0
 def get_initial(self):
     initial = FormView.get_initial(self)
     initial['start'] = now()
     return initial
Example #4
0
 def get_initial(self):
     initial = FormView.get_initial(self)
     initial["name"] = self.kwargs["pk"]
     return initial
Example #5
0
    def get_initial(self):
        """
        Automatically fills form fields for authenticated users.
        """

        return FormView.get_initial(self)