Wagtail CMS: How to subclass Wagtail Pages

Coding For Everybody
Coding For Everybody
4.7 هزار بار بازدید - 5 سال پیش - Subclassing is having a class
Subclassing is having a class (in this case it's a Wagtail Page) that can be used for other classes (Wagtail Page's). The parent class has all the common attributes for the child pages, and every child page will inherit everything from it's parent. In this lesson we'll explore that by creating a subclassed Article and Video Blog Page that share a common parent, and then we'll extend the functionality of both subclassed pages by adding new fields.

In this video we'll be subclassing a Blog page into 2 child Blog Pages with different templates. And we'll touch on the subject of .specific briefly, although the next video will be entirely about using .specific because it's a worthy subject on it's own.

Tutorial: https://learnwagtail.com/tutorials/ho...

Git Commit: https://github.com/CodingForEverybody...

Learn Wagtail from scratch with the official Wagtail for Beginners Course
https://learnwagtail.com/wagtail-for-...

Used in this video: Wagtail 2.4, Python 3.7, Django 2.1.5 #Wagtail #Django #Python
5 سال پیش در تاریخ 1397/12/01 منتشر شده است.
4,761 بـار بازدید شده
... بیشتر