I want to show suggestion of existing child record while adding child record to parent.
class IndustryInline(admin.TabularInline):
model = Industry
class ParentIndustriesAdmin(admin.ModelAdmin):
list_display = ('id', 'name')
search_fields = ['id', 'name', ]
ordering = ['-date_modified']
inlines = [
IndustryInline,
]
def save_model(self, request, obj, form, change):
obj.modified_by = request.user
obj.save()
admin.site.register(ParentIndustry, ParentIndustriesAdmin)
How to get suggestion for existing records like we get in case of ManytoMany relationship.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…