def GetSpudsForFan(cls, fan_page):
     from spudderaccounts.wrappers import RoleFan
     try:
         return get_user_mentions_activity(KrowdIOStorage.GetOrCreateForCurrentUserRole(RoleFan(fan_page)))
     except Exception as ex:
         logging.error("%s" % ex)
         return []
Exemplo n.º 2
0
def spuds_for_venue(request, venue_id):
    """
    Displays the SPUDS for the supplied venue
    :param request: any request
    :param venue_id: a valid ID of a Venue object
    :return: a table of SPUDs
    """
    storage = KrowdIOStorage.GetOrCreateForVenue(venue_id)
    venue_spuds = get_user_mentions_activity(storage)
    return render_to_response('spudderadmin/pages/reports/spuds.html', {
        'name': Venue.objects.get(id=venue_id).name,
        'spuds': venue_spuds
    },
                              context_instance=RequestContext(request))
Exemplo n.º 3
0
def spuds_for_venue(request, venue_id):
    """
    Displays the SPUDS for the supplied venue
    :param request: any request
    :param venue_id: a valid ID of a Venue object
    :return: a table of SPUDs
    """
    storage = KrowdIOStorage.GetOrCreateForVenue(venue_id)
    venue_spuds = get_user_mentions_activity(storage)
    return render_to_response('spudderadmin/pages/reports/spuds.html',
        {
            'name': Venue.objects.get(id=venue_id).name,
            'spuds': venue_spuds
        },
        context_instance=RequestContext(request))
 def GetSpudsForTeam(cls, team_page):
     try:
         team_spuds = get_user_mentions_activity(KrowdIOStorage.GetOrCreateForTeam(team_page.id))
     except Exception as ex:
         logging.error("%s" % ex)
         team_spuds = []
     try:
         spud_stream = get_spud_stream_for_entity(
             KrowdIOStorage.GetOrCreateFromEntity(
                 team_page.id,
                 EntityController.ENTITY_TEAM
             ))
     except Exception as ex:
         logging.error("%s" % ex)
         spud_stream = []
     return cls.MergeSpudLists(team_spuds, spud_stream)
 def GetSpudsForVenue(cls, venue):
     krowdio_entity = KrowdIOStorage.GetOrCreateFromEntity(venue.id, EntityController.ENTITY_VENUE)
     venue_spuds = get_user_mentions_activity(krowdio_entity)
     spud_stream = get_spud_stream_for_entity(krowdio_entity)
     return cls.MergeSpudLists(venue_spuds, spud_stream)