示例#1
0
	def prepare_initial_data(self, form_class, obj = None, **kwargs):
		data = helpers.form_initial_data(form_class, obj)
		if not obj:
			data[self.rel_field.name] = kwargs.get(self.rel_field.name)
		
		return data
示例#2
0
    def prepare_initial_data(self, form_class, obj = None, **kwargs):
        data = helpers.form_initial_data(form_class, obj)
        if not obj:
            data[self.rel_field.name] = kwargs.get(self.rel_field.name)

        return data
示例#3
0
	def prepare_initial_data(self, form_class, obj = None, **kwargs):
		return helpers.form_initial_data(form_class, obj)
示例#4
0
 def prepare_initial_data(self, form_class, obj = None, **kwargs):
     """Populates the model's form with data from the specified object"""
     return helpers.form_initial_data(form_class, obj, **kwargs)