Thank you Josh. On Thursday, April 3, 2014 12:00:48 PM UTC-4:30, Josh Cartmell wrote: > > Hey Jose, have a look at > https://mezzanine.jupo.org/docs/content-architecture.html#displaying-custom-content-types > > Basically you need to do page.custompage.custom_property because the > custom_property is an attribute of CustomPage, not Page. > > > On Thu, Apr 3, 2014 at 4:27 AM, José San Gil <[email protected]<javascript:> > > wrote: > >> Hello guys, >> >> I created a custom content type (CustomPage) and added a page_processor >> for it as follows: >> >> class CustomPage(Page): >> custom_property = models.CharField('Custom Property', max_length=100) >> >> ---- >> @processor_for(CustomPage) >> def my_method(request,page) >> property = page.custom_property >> ... >> >> The page processor works, but it is passing a Page's instance to >> my_method instead of the CustomPage instance (subclass). Therefore, it >> throws a KeyError when trying to get page.custom_property. Do you know how >> can I solve this to use my CustomPage on the page processor? >> >> Thank you >> >> -- >> 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] <javascript:>. >> 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.
