Exemple #1
0
def profil(request, player=''):
    jetzt = datetime.strptime(datetime.now().isoformat()[0:16], "%Y-%m-%dT%H:%M" )

    # User-Daten beschaffen
    if (player != '') or (player != None):
        try:
            myUser = User.objects.get(username = player)
        except User.DoesNotExist:
            myUser = request.user
    else:
        myUser = request.user
   

     
    userpk = myUser.pk

    begegnungen = Begegnung.objects.filter(datum__lt=jetzt)
    #tipps = Tipps.objects.filter(user=userpk, begegnung__in=begegnungen).order_by('tippDatum')
    tipps = Tipps.objects.filter(user=userpk, begegnung__in=begegnungen).order_by('begegnung__datum')

    # Highscore holen
    punkteListe = punkteAuswerten(request)


    #tipps2 = []
    #for object in sort(tipps, 'begegnung'):
    #    tipps2.append(object)

    #neueListe = tipps - begegnungen
    #tipps = tipps.filter(tippDatum__lte=jetzt)
    #tipps = filter(tippDatum__lt = jetzt)
    # Template aufrufen
    return render_to_response('appWMTippspiel/profil.html', {'myuser':myUser, 'tipps':tipps, 'jetzt':jetzt, 'player':player, 'punkteListe': punkteListe})
Exemple #2
0
def feed(request):
    ## Extracts the information from the feedURL = 'http://de.fifa.com/worldcup/news/rss.xml'
    #  @param self The object pointer.
    #  @param feedURL The URL of the feed as a String
    #  @return A HTML-String with the extracted feed information
    #feedURL = 'http://de.fifa.com/worldcup/news/rss.xml'  
    #feed = feedparser.parse(feedURL)
    
    feed = feedStart(request)
    #punkteListe = wmTippspiel.appWMTippspiel.views.punkteAuswerten(request)
    punkteListe = punkteAuswerten(request)
    
    return render_to_response('appWMTippspiel/index.html',
                             # {'entries': feed.entries[0:10]})
                              {'entries': feed.entries[0:10],'punkteListe': punkteListe[0:16]})