(
    user, client=None, since=None, until=None, public_only=False
)
return history
Returns chronologically ordered subscription history entries

    Setting device_id restricts the actions to a certain device
Returns chronologically ordered subscription history entries
Returns chronologically ordered subscription history entries
def get_subscription_history(
    user, client=None, since=None, until=None, public_only=False
):
    """Returns chronologically ordered subscription history entries

    Setting device_id restricts the actions to a certain device
    """

    # django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
    from mygpo.history.models import SUBSCRIPTION_ACTIONS, HistoryEntry

    logger.info("Subscription History for {user}".format(user=user.username))
    history = (
        HistoryEntry.objects.filter(user=user)
        .filter(action__in=SUBSCRIPTION_ACTIONS)
        .order_by("timestamp")
    )

    if client:
        logger.info(u"... client {client_uid}".format(client_uid=client.uid))
        history = history.filter(client=client)

    if since:
        logger.info("... since {since}".format(since=since))
        history = history.filter(timestamp__gt=since)

    if until:
        logger.info("... until {until}".format(until=until))
        history = history.filter(timestamp__lte=until)

    if public_only:
        # django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
        from mygpo.usersettings.models import UserSettings

        logger.info("... only public")
        private = UserSettings.objects.get_private_podcasts(user)
        history = history.exclude(podcast__in=private)

    return history
def get_subscription_history ( user , client = None , since = None , until = None , public_only = False ) : # django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. from mygpo . history . models import SUBSCRIPTION_ACTIONS , HistoryEntry logger . info ( "Subscription History for {user}" . format ( user = user . username ) ) history = ( HistoryEntry . objects . filter ( user = user ) . filter ( action__in = SUBSCRIPTION_ACTIONS ) . order_by ( "timestamp" ) ) if client : logger . info ( u"... client {client_uid}" . format ( client_uid = client . uid ) ) history = history . filter ( client = client ) if since : logger . info ( "... since {since}" . format ( since = since ) ) history = history . filter ( timestamp__gt = since ) if until : logger . info ( "... until {until}" . format ( until = until ) ) history = history . filter ( timestamp__lte = until ) if public_only : # django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. from mygpo . usersettings . models import UserSettings logger . info ( "... only public" ) private = UserSettings . objects . get_private_podcasts ( user ) history = history . exclude ( podcast__in = private ) return history