mardi 5 mai 2015

Django Ical with user's content

I'm trying to use Django_ical to export some custom user content to ical. I'm pretty inexperienced with class based views in django so forgive me if this is a simple question.

from django_ical.views import ICalFeed

class ical_export(ICalFeed):
    filename = "offers.ics"
    def items(self):
       user_offers = Offer.objects.filter(user_id=request.user)
       return user_offers

def item_link(item):
    reverse("show",args=[item().id])

My question is: how can I access the request object in this case?

Aucun commentaire:

Enregistrer un commentaire