I have a custom mode that in inherits from the Mezzanine Page model, let's 
just call it PressRoom. I have no problem adding a new PressRoom page in 
the admin interface. I tried dragging the page and making it a child of one 
of the top level pages. Then I tried to delete the page and it threw this 
error:

IntegrityError at /admin/pages/page/3/delete/(1451, 'Cannot delete or update a 
parent row: a foreign key constraint fails (`main_django`.`main_pressroom`, 
CONSTRAINT `page_ptr_id_refs_id_61318436` FOREIGN KEY (`page_ptr_id`) 
REFERENCES `pages_page` (`id`))')

I have a custom mode that in inherits from the Mezzanine Page model:

class PressRoom(Page):
    rel_canonical = models.CharField(blank=True, max_length=256)
    pressreleases = PressRelease.objects.all()

Here is the corresponding admin.py code:

class PressRoomAdmin(reversion.VersionAdmin, PageAuthGroupAdminMixin, 
PageAdmin):
    model = appdmodels.PressRoom
    fieldsets = (
        (None, {
            'fields': (
                'title',
                'status',
                'publish_date',
                'in_menus',
                'login_required',
            ),
        }),
        ('Meta', {
            'fields' : (
                '_meta_title',
                'slug',
                'rel_canonical',
                'description',
                'keywords',
                'gen_description',
                'in_sitemap',
            ),
        }),
    )

admin.site.register(appdmodels.PressRoom, PressRoomAdmin)

I have a feeling it has to do with the page_ptr_id not being updated, but 
I'm not sure what and where to update. Or perhaps I broke some convention 
and now it's throwing errors. Any help would be appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to