This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "account/base.html" %} | |
{% load i18n %} | |
{% load account %} | |
{% load url from future %} | |
{% block head_title %}{% trans "Signup" %}{% endblock %} | |
{% block content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Podcast(models.Model): | |
title = models.CharField(max_length=200) | |
description = models.TextField(blank=True) | |
image = models.FileField(upload_to=get_upload_file_name, blank=True) | |
homepage = models.URLField(blank=True) | |
donate_url = models.URLField(blank=True) | |
# categories = ... | |
# keywords = ... | |
# followers = ... | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def quote_create(request): | |
if request.method == "POST": | |
pform = PersonQuotedCreateForm(request.POST, instance=PersonQuoted()) | |
tform = TagCreateForm(request.POST, instance=Tag()) | |
qform = QuoteCreateForm(request.POST, instance=Quote()) | |
if pform.is_valid() and tform.is_valid() and qform.is_valid(): | |
new_personquoted = pform.save() | |
new_tag = tform.save() | |
new_quote = qform.save() | |
return HttpResponseRedirect('/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
podcast.title = feed['title'] | |
podcast.description = feed['description'] | |
podcast.homepage = feed['homepage'] | |
if feed['keywords_list'] == '': | |
pass | |
else: | |
keywords_list = feed['keywords_list'] | |
# remove duplicates from keywords_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Map feed information to Podcast | |
podcast.title = feed['title'] | |
podcast.description = feed['description'] | |
podcast.homepage = feed['homepage'] | |
if feed['keywords_list'] == '': | |
pass | |
else: | |
keywords_list = feed['keywords_list'] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en-US" prefix="og: http://ogp.me/ns#" xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#"> | |
<head> | |
<meta charset=”utf-8”> | |
{% block head_title %} | |
<title>Podverse - Find and share podcast highlights</title> | |
{% endblock %} | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content="Find and share highlights of your favorite podcasts. Connect with podcast listeners. Raise money for your podcast. Inspired by reddit."> | |
<link rel="publisher" href=""> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
candidates.py | |
class CandidateDetailView(DetailView): | |
model = Candidate | |
context_object_name = 'candidate' | |
def get_context_data(self, **kwargs): | |
context = super(CandidateDetailView, self).get_context_data(**kwargs) | |
context['election'] = self.get_object().election | |
context['previous_candidates'] = Candidate.objects.order_by('id').filter(election_id=self.get_object().election.id).filter(is_approved=True).filter(id__lt=self.get_object().id) | |
context['next_candidates'] = Candidate.objects.order_by('id').filter(election_id=self.get_object().election.id).filter(is_approved=True).filter(id__gt=self.get_object().id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<script type="text/javascript"> | |
$('.searchAhead').typeahead({ | |
source: function(query, process) { | |
return $.get('/lookup/university/', { query: query }, function (data) { | |
return process(data.options); | |
}); | |
} | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When I visit the following URL http://127.0.0.1:8000/lookup/universities/?query=K | |
The page displays the following text: | |
{"options": ["Kenny University", "Kent State"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
playlist: { | |
episode: { | |
title: "#265 - The episode where some stuff happened", | |
duration: "50:25", | |
pubDate: "2016-02-07 22:30:55 +0000", | |
podcast: { | |
title: "The Best Podcast Ever Show" | |
} | |
}, |
OlderNewer