def google_calendar_url(self): data = [('action', 'TEMPLATE'), ('text', self.title.encode('utf-8')), ('dates', '%s/%s' % (time.strftime('%Y%m%dT%H%M%SZ', to_utc(self.start_date)), time.strftime('%Y%m%dT%H%M%SZ', to_utc(self.end_date)))), ('sprop', 'website:www.kiberpipa.org'), ('sprop', 'name:Kiberpipa - %s' % self.project.name.encode('utf-8')), # take first 24 words of announce ('details', (truncatewords(sanitize_html(self.announce), 24)).encode('utf-8')), ('location', '%s, Kiberpipa, Ljubljana' % self.place), ] qs = urllib.urlencode(data) return 'http://www.google.com/calendar/event?' + qs
result = u'' for i in events: result += capfirst(unicode(i.start_date.strftime('%A, %d. %b. %Y %H:%M\n'), 'utf-8')) result += '%s: %s\n' % (unicode(i.project), unicode(i.title)) predavatelji = [unicode(s.person.name) for s in Sodelovanje.objects.filter(event=i, tip=1)] if predavatelji: result += ', '.join(predavatelji) result += '\n' moderatorji = [unicode(s.person.name) for s in Sodelovanje.objects.filter(event=i, tip=3)] if moderatorji: result += 'moderira ' result += ', '.join(moderatorji) result += '\n' result += '\n\n' result += truncchar(sanitize_html(i.announce), 250) result += u'\n\n\nVeč o tem:\nhttp://%s%s\n' % (current_page.domain, i.get_absolute_url()) result += i.start_date.strftime('\n\n//////////////////////////////////////////////////\n\n') result += u""" Kiberpipa Kersnikova 6 1000 Ljubljana pon.-pet.: 10.00 - 22.00 prost vstop / prost dostop / prosto programje info at kiberpipa.org Spletna stran: http://www.kiberpipa.org/