Skip to content
Extraits de code Groupes Projets

Comparer les révisions

Les modifications sont affichées comme si la révision source était fusionnée avec la révision cible. En savoir plus sur la comparaison des révisions.

Source

Sélectionner le projet cible
No results found
Sélectionner une révision Git

Cible

Sélectionner le projet cible
  • la-quadrature-du-net/memopol/memopol
  • lnclt/political_memory
  • arthur/political_memory
  • agrausem/political_memory
  • periode/memopol
  • Anthony/memopol
  • Porkepix/memopol
  • jaster/memopol
  • luxcem/memopol
  • TAlone/memopol
10 résultats
Sélectionner une révision Git
Afficher les modifications
Affichage de
avec 196 ajouts et 406 suppressions
{
"status_code": 200
}
\ No newline at end of file
[
{
"proposal": "http://testserver/api/proposals/1/",
"representative": "http://testserver/api/representatives/1/",
"position": "abstain"
},
{
"proposal": "http://testserver/api/proposals/1/",
"representative": "http://testserver/api/representatives/2/",
"position": "abstain"
},
{
"proposal": "http://testserver/api/proposals/2/",
"representative": "http://testserver/api/representatives/1/",
"position": "for"
},
{
"proposal": "http://testserver/api/proposals/2/",
"representative": "http://testserver/api/representatives/2/",
"position": "for"
},
{
"proposal": "http://testserver/api/proposals/3/",
"representative": "http://testserver/api/representatives/1/",
"position": "against"
},
{
"proposal": "http://testserver/api/proposals/3/",
"representative": "http://testserver/api/representatives/2/",
"position": "against"
},
{
"proposal": "http://testserver/api/proposals/4/",
"representative": "http://testserver/api/representatives/1/",
"position": "for"
},
{
"proposal": "http://testserver/api/proposals/4/",
"representative": "http://testserver/api/representatives/2/",
"position": "against"
},
{
"proposal": "http://testserver/api/proposals/5/",
"representative": "http://testserver/api/representatives/1/",
"position": "abstain"
},
{
"proposal": "http://testserver/api/proposals/5/",
"representative": "http://testserver/api/representatives/2/",
"position": "against"
},
{
"proposal": "http://testserver/api/proposals/6/",
"representative": "http://testserver/api/representatives/1/",
"position": "for"
}
]
\ No newline at end of file
{
"status_code": 200
}
\ No newline at end of file
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = 'notsecret'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'test.db'),
}
}
INSTALLED_APPS = (
'django.contrib.staticfiles',
'rest_framework',
'representatives',
'representatives_votes',
)
DEBUG = True
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
ROOT_URLCONF = 'representatives_votes.tests.urls'
STATIC_URL = '/static/'
USE_I18N = True
USE_L10N = True
USE_TZ = True
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'simple': {
'format': '%(levelname)s[%(module)s]: %(message)s'
},
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
},
'loggers': {
'django': {
'handlers': ['console'],
'level': 'INFO'
},
'representatives': {
'handlers': ['console'],
'level': 'DEBUG'
},
'representatives_votes': {
'handlers': ['console'],
'level': 'DEBUG'
},
},
}
from django import test
from responsediff.response import Response
class RepresentativeManagerTest(test.TestCase):
fixtures = ['representatives_votes_test.json']
def functional_test(self, queries, url):
client = test.client.Client()
client.get(url)
with self.assertNumQueries(queries):
result = client.get(
url,
HTTP_ACCEPT='application/json; indent=4',
)
Response.for_test(self).assertNoDiff(result)
def test_dossier(self):
# One for dossier
# One for proposals
# One for documents
self.functional_test(3, '/api/dossiers/1/')
def test_dossiers(self):
self.functional_test(1, '/api/dossiers/')
def test_proposal(self):
# One for proposal and dossier + 1 for votes
self.functional_test(2, '/api/proposals/1/')
def test_proposals(self):
self.functional_test(1, '/api/proposals/')
def test_vote(self):
self.functional_test(1, '/api/votes/1/')
def test_votes(self):
self.functional_test(1, '/api/votes/')
from django.conf.urls import include, url
from rest_framework import routers
from representatives_votes.api import (
DossierViewSet,
ProposalViewSet,
VoteViewSet,
)
from representatives.api import (
ChamberViewSet,
ConstituencyViewSet,
CountryViewSet,
GroupViewSet,
MandateViewSet,
RepresentativeViewSet,
)
router = routers.DefaultRouter()
router.register('countries', CountryViewSet, 'api-country')
router.register('chambers', ChamberViewSet, 'api-chamber')
router.register('constituencies', ConstituencyViewSet, 'api-constituency')
router.register('groups', GroupViewSet, 'api-group')
router.register('mandates', MandateViewSet, 'api-mandate')
router.register('representatives', RepresentativeViewSet, 'api-representative')
router.register('dossiers', DossierViewSet, 'api-dossier')
router.register('proposals', ProposalViewSet, 'api-proposal')
router.register('votes', VoteViewSet, 'api-vote')
urlpatterns = [
url('api/', include(router.urls)),
]
Fichier supprimé
Impossible d'afficher diff de source : il est trop volumineux. Options pour résoudre ce problème : voir le blob.
Fichier supprimé
Fichier supprimé
@import 'font';
@import 'header';
@import 'footer';
@import 'navigation';
@import 'table';
@import 'legislature';
@import 'positions';
body {
background: #E5E5E5;
}
.container, .container-fluid {
background: white;
}
.main-container {
padding-top: 15px;
}
.label a {
color: white;
}
.label {
margin: 0 1px;
}
\ No newline at end of file
@font-face {
font-family: 'propagandaregular';
src: url('../fonts/propagan-webfont.eot');
src: url('../fonts/propagan-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/propagan-webfont.woff') format('woff'), url('../fonts/propagan-webfont.ttf') format('truetype'), url('../fonts/propagan-webfont.svg#propagandaregular') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'sansus_webissimoitalic';
src: url('../fonts/sansus_webissimo-italic-webfont-webfont.eot');
src: url('../fonts/sansus_webissimo-italic-webfont-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/sansus_webissimo-italic-webfont-webfont.woff') format('woff'), url('../fonts/sansus_webissimo-italic-webfont-webfont.ttf') format('truetype'), url('../fonts/sansus_webissimo-italic-webfont-webfont.svg#sansus_webissimoitalic') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'sansus_webissimoregular';
src: url('../fonts/sansus_webissimo-regular-webfont-webfont.eot');
src: url('../fonts/sansus_webissimo-regular-webfont-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/sansus_webissimo-regular-webfont-webfont.woff') format('woff'), url('../fonts/sansus_webissimo-regular-webfont-webfont.ttf') format('truetype'), url('../fonts/sansus_webissimo-regular-webfont-webfont.svg#sansus_webissimoregular') format('svg');
font-weight: normal;
font-style: normal;
}
#footer {
background: #5B8EDC;
color: white;
text-align: center;
padding: 20px;
a {
color: white;
text-decoration: underline;
}
}
#header {
background: #5B8EDC;
color: white;
h1 {
font-family: 'propagandaregular';
margin: 0;
padding-top:20px;
}
a {
color: white;
text-decoration:none;
}
.organization {
font-style: italic;
}
}
#nav {
padding: 0;
ul.nav {
clear: both;
display: flex;
font-weight: bold;
border-bottom: #eee 1px solid;
}
}
#logo {
float: left;
img {
width: 100px;
}
}
\ No newline at end of file
.representative {
h1 {
text-align: center;
}
p.photo {
text-align: center;
}
tr.score {
th {
vertical-align: bottom;
}
td {
font-size: 1.4em;
.label {
padding: 2px;
}
}
}
}
.positions form {
width: 50%;
margin: auto;
}
.vote_negative {
color: red;
}
.vote_positive {
color: green;
}
.vote_abstain {
color: #333;
}
.representative_grid {
display: flex;
flex-wrap: wrap;
justify-content: center;
.representative_item {
width: 300px;
margin: 2px;
padding: 10px;
// border: 1px solid black;
background: #f5f5f5;
.photo {
float: left;
}
.name {
font-weight: bold;
}
ul {
list-style-type: none;
text-indent: 10px;
}
}
}
\ No newline at end of file
.pagination-block {
margin-bottom: 10px;
color: #999;
font-size: 0.9em;
nav {
text-align: center;
}
.count {
text-align: left;
}
}
\ No newline at end of file
@quote-size: 1em;
.quote {
width: 70%;
margin: auto;
}
.quote-header {
font-style: italic;
}
.long-quote {
p:first-child:before {
content: '« ';
font-style: italic;
font-size: @quote-size;
}
p:last-child:after {
content: ' »';
font-style: italic;
font-size: @quote-size;
text-align: right;
}
}
\ No newline at end of file
table.detail-view > tbody > tr > td, table.detail-view > tbody > tr > th {
border-top: 0;
}
table.detail-view {
th {
text-align: right;
}
th:after{
content: ' :';
}
}
.icon-cell {
text-align: center;
}
.grid-list-selector {
// text-align: right;
}
\ No newline at end of file