コード例 #1
0
 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 []
コード例 #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))
コード例 #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))
コード例 #4
0
 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)
コード例 #5
0
 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)