Created
October 6, 2019 21:28
-
-
Save ivan-vilches/23342d58953bf71c6607247f927c4ebe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
""" IMPORTING DATA FROM FLEX APP """ | |
from flex.models import FlexPage | |
from wagtail.core.models import Page | |
class HomePage(Page): | |
""" Home page model """ | |
templates = "home/home_page.html" | |
max_count = 1 | |
def get_context(self, request): | |
context = super().get_context(request) | |
# Add extra variables and return the updated context | |
context['myDatafromflexapp'] = FlexPage.objects.child_of(self).live() | |
return context |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment