You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class ExampleForm(ModelForm):
class Meta:
model = Example
exclude = []
def is_multipart(self, *args, **kwargs):
return True
class ExampleTabItemGalleryInline(GalleryFieldOverride, NestedTabularInline):
model = ExampleTabItemGallery
fk_name = 'tab_item'
class ExampleTabItemAdmin(GalleryFieldOverride, NestedStackedInline):
model = ExampleTabItem
fk_name = 'tab'
inlines = [ExampleTabItemGalleryInline, ]
class ExampleTabAdmin(NestedStackedInline):
model = ExampleTab
inlines = [ExampleTabItemAdmin, ]
fk_name = 'example'
class ExampleAdmin(NestedModelAdmin):
inlines = [ExampleTabAdmin, ]
form = ExampleForm
save_as = True
When i save object with _saveasnew i have next trouble: saves only first inline model, that is -- ExampleTab and Example, but models nested into ExampleTab (ExampleTabItem, ExampleTabItemGallery) not saved... their fields is empty.
The text was updated successfully, but these errors were encountered:
dbkv9
changed the title
Multiple inline models save as new not working
Multiple nested inline models save as new not working
Sep 28, 2023
Hi! I have next code (admin.py):
When i save object with _saveasnew i have next trouble: saves only first inline model, that is -- ExampleTab and Example, but models nested into ExampleTab (ExampleTabItem, ExampleTabItemGallery) not saved... their fields is empty.
The text was updated successfully, but these errors were encountered: