-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
204 additions
and
119 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
from django.db import models | ||
from datetime import datetime | ||
|
||
|
||
class Consultation(models.Model): | ||
lang = models.CharField(max_length=128) | ||
date = models.DateTimeField() | ||
link = models.CharField(max_length=1024) | ||
key = models.CharField(max_length=128) | ||
title = models.CharField(max_length=1024) | ||
|
||
class Meta: | ||
unique_together = ('lang', 'key') | ||
|
||
def __unicode__(self): | ||
return self.link + "-" + self.title.encode("utf-8") + "-" + self.lang | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,77 @@ | ||
from django.conf.urls import url, include | ||
from django.conf.urls import include, url | ||
from rest_framework import routers | ||
|
||
from api import views | ||
|
||
router = routers.DefaultRouter() | ||
router.register(r'latest_bills', views.LatestBillsViewSet, base_name='latest_bills') | ||
router.register(r'latest_votes', views.LatestVotesViewSet, base_name='latest_votes') | ||
router.register(r'votes_search/(?P<keyword>.*)', views.VotesSearchViewSet, base_name='votes_search') | ||
router.register(r'parties', views.PartiesViewSet) | ||
router.register(r'meetings', views.MeetingsViewSet, base_name='meetings') | ||
router.register(r'meetings/(?P<year>[0-9]+)', views.MeetingsViewSet, base_name='meetings') | ||
router.register(r'questions', views.LatestQuestionsViewSet, base_name='questions') | ||
router.register(r'questions/(?P<keyword>\w*)', views.LatestQuestionsViewSet, base_name='questions') | ||
router.register(r'questions/(?P<keyword>\w*)/(?P<page>[0-9]+)', views.LatestQuestionsViewSet, base_name='questions') | ||
router.register(r'most_present', views.MostPresentIndividualsViewSet, base_name='most_present') | ||
router.register(r'most_absent', views.MostAbsentIndividualsViewSet, base_name='most_absent') | ||
router.register(r'most_speech', views.MostSpeechIndividualsViewSet, base_name='most_speech') | ||
router.register(r'subscribe', views.SubscribeViewSet, base_name='subscribe') | ||
router.register(r'consultations', views.ConsultationsViewSet, base_name='consultations') | ||
router.register(r'weather', views.WeatherViewSet, base_name='weather') | ||
router.register(r'party/(?P<pk>.+)', views.PartyDetailViewSet, base_name='party') | ||
router.register(r'bills', views.AllBillsViewSet, base_name='bills') | ||
router.register(r'news', views.NewsViewSet, base_name='news') | ||
router.register(r'bills/(?P<keyword>\w*)', views.AllBillsViewSet, base_name='bills') | ||
router.register(r'bills/(?P<keyword>\w*)/(?P<page>[0-9]+)', views.AllBillsViewSet, base_name='bills') | ||
router.register(r'important_motion', views.ImportantMotionViewSet, base_name='important_motion') | ||
router.register(r'speeches/(?P<keyword>\w*)', views.MeetingSpeechSearchViewSet, base_name='speeches') | ||
router.register(r'speeches', views.MeetingSpeechSearchViewSet, base_name='speeches') | ||
router.register(r'latest_bills', | ||
views.LatestBillsViewSet, | ||
base_name='latest_bills') | ||
router.register(r'latest_votes', | ||
views.LatestVotesViewSet, | ||
base_name='latest_votes') | ||
router.register(r'votes_search/(?P<keyword>.*)', | ||
views.VotesSearchViewSet, | ||
base_name='votes_search') | ||
router.register(r'parties', | ||
views.PartiesViewSet) | ||
router.register(r'meetings', | ||
views.MeetingsViewSet, | ||
base_name='meetings') | ||
router.register(r'meetings/(?P<year>[0-9]+)', | ||
views.MeetingsViewSet, | ||
base_name='meetings') | ||
router.register(r'questions', | ||
views.LatestQuestionsViewSet, | ||
base_name='questions') | ||
router.register(r'questions/(?P<keyword>\w*)', | ||
views.LatestQuestionsViewSet, | ||
base_name='questions') | ||
router.register(r'questions/(?P<keyword>\w*)/(?P<page>[0-9]+)', | ||
views.LatestQuestionsViewSet, | ||
base_name='questions') | ||
router.register(r'most_present', | ||
views.MostPresentIndividualsViewSet, | ||
base_name='most_present') | ||
router.register(r'most_absent', | ||
views.MostAbsentIndividualsViewSet, | ||
base_name='most_absent') | ||
router.register(r'most_speech', | ||
views.MostSpeechIndividualsViewSet, | ||
base_name='most_speech') | ||
router.register(r'subscribe', | ||
views.SubscribeViewSet, | ||
base_name='subscribe') | ||
router.register(r'consultations', | ||
views.ConsultationsViewSet, | ||
base_name='consultations') | ||
router.register(r'weather', | ||
views.WeatherViewSet, | ||
base_name='weather') | ||
router.register(r'party/(?P<pk>.+)', | ||
views.PartyDetailViewSet, | ||
base_name='party') | ||
router.register(r'bills', | ||
views.AllBillsViewSet, | ||
base_name='bills') | ||
router.register(r'news', | ||
views.NewsViewSet, | ||
base_name='news') | ||
router.register(r'bills/(?P<keyword>\w*)', | ||
views.AllBillsViewSet, | ||
base_name='bills') | ||
router.register(r'bills/(?P<keyword>\w*)/(?P<page>[0-9]+)', | ||
views.AllBillsViewSet, | ||
base_name='bills') | ||
router.register(r'important_motion', | ||
views.ImportantMotionViewSet, | ||
base_name='important_motion') | ||
router.register(r'speeches/(?P<keyword>\w*)', | ||
views.MeetingSpeechSearchViewSet, | ||
base_name='speeches') | ||
router.register(r'speeches', | ||
views.MeetingSpeechSearchViewSet, | ||
base_name='speeches') | ||
urlpatterns = [ | ||
url(r'', include(router.urls)) | ||
] | ||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +0,0 @@ | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models | ||
|
||
# Create your models here. | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from django.conf.urls import url, include | ||
from district.views import * | ||
from django.conf.urls import url | ||
|
||
from district.views import index_view | ||
|
||
urlpatterns = [ | ||
url(r'^$', index_view) | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from django.shortcuts import render | ||
from django.db.models import Count | ||
def index_view(request): | ||
return render(request, 'district/index.html', {'nbar': 'home', 'tbar':'dc'}) | ||
|
||
|
||
def index_view(request): | ||
return render(request, | ||
'district/index.html', | ||
{'nbar': 'home', 'tbar': 'dc'}) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
from django.shortcuts import render | ||
|
||
# Create your views here. | ||
|
||
|
||
def index_view(request): | ||
return render(request, 'index.html', {'tbar': 'home', 'nbar':'home'}) | ||
|
||
def other_projects_view(request): | ||
return render(request, 'other_projects.html', {'tbar': 'home', 'nbar':'projects'}) | ||
|
||
|
||
return render(request, | ||
'other_projects.html', | ||
{'tbar': 'home', 'nbar':'projects'} | ||
) |
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
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
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
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
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
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
Oops, something went wrong.