Hello Hamza.

Displayable is an abstract model, which means you can use is as a base for your own models, but it doesn't exist in the database by itself. The fields defined in Displayable will simply become part of the model that inherits from it.

For example, if you create "class PortfolioItem(Displayable)" you'll be able to do:

item = PortofolioItem.objects.get(...)
item.title # This is provided by Displayable
item.slug # Also provided by Displayable

And yes, you'll need to provide your own views and urls to interact with models that inherit from Displayable. I recommend you take a look at mezzanine.blog for a great example of how to build models, views, and urls on top of Displayable.


On 2017-10-06 8:42 AM, Hamza Jutt wrote:
When extending from *Page* all you gotta do in template is access

|
{{page.some_model.some_field }}
|

but when extending *Displayable* that does not work. So How to access this in template. Or is there even a way without creating custom urls and views?

--
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] <mailto:[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