Ejemplo n.º 1
0
def current_presentation(request):

    presentation = SimpleLazyObject(lambda: fetch_current_presentation(request.user))

    def get_presentation_records():
        try:
            return list(presentation.items.values_list('record_id', flat=True).distinct())
        except AttributeError:
            return []

    presentation_records = IterableLazyObject(get_presentation_records)

    return {
        'current_presentation': presentation,
        'current_presentation_records': presentation_records,
    }
Ejemplo n.º 2
0
def current_presentation(request):

    presentation = SimpleLazyObject(lambda: fetch_current_presentation(request.user))

    def get_presentation_records():
        try:
            return list(presentation.items.values_list('record_id', flat=True).distinct())
        except AttributeError:
            return []

    presentation_records = IterableLazyObject(get_presentation_records)

    return {
        'current_presentation': presentation,
        'current_presentation_records': presentation_records,
    }
Ejemplo n.º 3
0
 def render(self, context):
     user = self.user.resolve(context)
     context[self.var_name] = fetch_current_presentation(user)
     return ''
Ejemplo n.º 4
0
 def render(self, context):
     user = self.user.resolve(context)
     context[self.var_name] = fetch_current_presentation(user)
     return ""