Skip to content

Instantly share code, notes, and snippets.

Last active Oct 15, 2017
What would you like to do?
De-Dupe / Return Draft DjangoCMS Plugin Instances
def formfield_for_foreignkey(self, db_field, request, **kwargs):
if == "my_plugin_fk":
kwargs["queryset"] = models.MyPluginModel.objects.filter(
Q(placeholder__static_draft__isnull=False) |
return super().formfield_for_foreignkey(db_field, request, **kwargs)

This comment has been minimized.

Copy link
Owner Author

@aubricus aubricus commented Oct 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment