Рет қаралды 3,112
While working with Wagtail's v2 API, sometimes you'll run into a scenario where you need to serialize (turn model fields into JSON) on your own. Wagtail's API will handle as much of it as it possibly can, but it's impossible to know every possible situation. That's where Django Rest Framework comes in.
Using Django Rest Framework with Wagtails v2 API, we can customize ANY field the way we want. In this short video, we take a look at creating a new field entirely by overwriting an image, but we also look at serializing (JSONifying) an image field from a ForeignKey inside an Orderable. Don't worry, it's not as crazy as it sounds!
Tutorial: learnwagtail.c...
Learn Wagtail from scratch with the official Wagtail for Beginners Course
learnwagtail.c...
Git Commit: github.com/Cod...
Used in this video: Wagtail 2.4, Python 3.7, Django 2.1.5
Outro Template made by Grabster - / grabstertv #Wagtail #Django #Python