i have a model admin form with 3 inlines, my problem is that i want one of the inline forms be saved with data from parent form. eg. fieldfrominline = fieldfromparent
i tried save_formset medthod but probably i am doing something wrong cause i couldn't get/set the fields of inline form and specify which of inlines is to be saved..
class multifield1_inline(admin.TabularInline): model = multifield1 extra = 1 class multifield2_inline(admin.TabularInline): model = multifield2 extra = 1 class multifield3_inline(admin.TabularInline): model = multifield3 extra = 1 class baseform(admin.ModelAdmin): model = base inlines=[multifield1_inline, multifield2_inline, multifield3_inline,] def save_model(self, request, obj, form, change): obj.cuser = request.user obj.save()
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment