Skip to content

Instantly share code, notes, and snippets.

@ivan-vilches
Created October 6, 2019 21:28
Show Gist options
  • Save ivan-vilches/23342d58953bf71c6607247f927c4ebe to your computer and use it in GitHub Desktop.
Save ivan-vilches/23342d58953bf71c6607247f927c4ebe to your computer and use it in GitHub Desktop.
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