def where_entry_visible_future(query):
    """ Generate a where clause for entries that are visible now or in the future """

    return orm.select(
        e for e in query
        if e.status in (model.PublishStatus.PUBLISHED.value,
                        model.PublishStatus.SCHEDULED.value))
Generate a where clause for entries that are visible now or in the future