-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrity Error on delete #19
Comments
Thanks, this is really helpful to know! There are a few things I'm curious about:
|
Sure thing. Here are the details of a minimal app that renders the error message in admin. Stacktrace
Modelclass Stuff(models.Model):
title = models.CharField(max_length=255)
content = PlaceholderField("stuff_content")
def __unicode__(self):
return self.title Plugin modelclass ContentBlock(ContentItem):
"""
Simple text block with title
"""
title = models.CharField(_("Title"), max_length=255)
body = models.TextField()
class Meta:
verbose_name=_("Content stuff")
verbose_name_plural = _("Content stuff")
def __unicode__(self):
return self.title
class TwoColumnBlock(ContentItem):
"""
Two column block
"""
left_columns = models.TextField()
right_columns = models.TextField()
class Meta:
verbose_name=_("Two Column stuff")
verbose_name_plural = _("Two Column stuff")
def __unicode__(self):
return self.left_columns Plugin content plugins@plugin_pool.register
class ContentBlockPlugin(ContentPlugin):
model = ContentBlock
render_template = "plugins/contentblock.html"
@plugin_pool.register
class TwoColumnBlockPlugin(ContentPlugin):
model = TwoColumnBlock
render_template = "plugins/twocolumnblock.html" |
Sorry for not getting back to you, I completely missed your message. I'll try to see whether I can fix this. As workaround, try adding the from fluent_contents.models import ContentItemRelation
class Stuff(models.Model):
title = models.CharField(max_length=255)
content = PlaceholderField("stuff_content")
contentitem_set = ContentItemRelation() This change causes the admin delete view and "collector object" to detect those contentitems which are attached to your model. I'll see if I can make this happen automatically. |
I've run into this problem also, and I came up with the same workaround that you mention. It's been working for me. It would be nice if you could fix this in the plugin though! |
Same problem with fluent_pages.pagetypes.fluentpages, cf django-fluent/django-fluent-pages#57 |
I've come across an issue where I can't delete an object with a placeholder field.
update or delete on table "fluent_contents_placeholder" violates foreign key constraint "placeholder_id_refs_id_8e1f1b78" on table "fluent_contents_contentitem"
DETAIL: Key (id)=(9) is still referenced from table "fluent_contents_contentitem".
It seems like the delete doesn't cascade properly to the fluent_contents_contentitem.
using django 1.5.1
latest fluent-contents via git
Let me know what other information I need to provide.
The text was updated successfully, but these errors were encountered: