How do I ensure that a blank InlineModelAdmin is saved when the parent form is submitted? Here's a simplified version of my code:
#### class Flagset(Model): group = OneToOneField(Group) flag = BooleanField() class FlagsetInline(TabularInline): model = Flagset class GroupAdmin(ModelAdmin): inlines = [FlagsetInline] admin.site.unregister(Group) admin.site.register(Group, GroupAdmin) #### When I save a new Group, I want a Flagset to be created whether the Flagset.flag box is checked or not. If I leave it blank, no object is created. I tried adding a signal handler like the following to create the object: #### @receiver(post_save, sender=Group) def create_flagset(sender, **kwargs): if kwargs['created']: Flagset.objects.get_or_create(group=kwargs['instance']) #### This works when the flag is not set, but causes an error if it is (because the Flagset is created twice, it looks like). What can I do to make this scenario work whether the inline is touched or not? Thanks, Dan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.