Hi Wim,

Use the source, Luke! If you look at the source for pages.models
<https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/pages/models.py#L285-L293>,
you will see that you can do multiple inheritance. So instead of `class
FeaturedPage(Page)`, use `class FeaturedPage(Page, RichText)`, being sure
to include `from mezzanine.core import RichText` in your imports.

Even better, though, would be to use field injection as Simone wrote while
I composed my reply.

best,
ken


On Tue, Sep 2, 2014 at 9:32 AM, Simone Dalla <[email protected]> wrote:

>
>
>
> 2014-09-02 15:04 GMT+02:00 Wim Feijen <[email protected]>:
>
> Hello,
>>
>> I'd like to add a featured_image to the Page model.
>>
>> Following the advice on
>> http://mezzanine.jupo.org/docs/content-architecture.html#creating-custom-content-types,
>> I created my own Page model.
>>
>
> Read the note at the end of
> http://mezzanine.jupo.org/docs/content-architecture.html#creating-custom-content-types
> :
>
> "When creating custom content types, you must inherit directly from the
> Page model. Further levels of subclassing are currently not supported.
> Therefore you cannot subclass the RichTextPage or any other custom content
> types you create yourself. Should you need to implement a WYSIWYG editable
> field in the way the RichTextPage model does, you can simply subclass both
> Page and RichText, the latter being imported from mezzanine.core.models."
>
> or use "Field Injection"
> http://mezzanine.jupo.org/docs/model-customization.html?highlight=inject#field-injection
>
> Simone
>
>
> --
> Simo
>
> - Registered Linux User #395060
>
> - Software is like sex, it is better when it is free  --> Linus B.
> Torvalds
>
> --
> 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.
>

-- 
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