Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Anthony
memopol
Commits
8c194430
Commit
8c194430
authored
May 30, 2016
by
Nicolas Joyard
Browse files
Fix test errors
parent
98a0fae0
Changes
5
Hide whitespace changes
Inline
Side-by-side
representatives_positions/contrib/import_positions.py
View file @
8c194430
...
...
@@ -3,7 +3,6 @@
import
csv
import
django
from
django.apps
import
apps
from
django.db
import
transaction
import
logging
import
sys
import
re
...
...
@@ -106,4 +105,3 @@ def main(stream=None):
imported
=
imported
+
1
logger
.
info
(
'%d rows imported, %d rows rejected'
,
imported
,
len
(
rejected
))
representatives_positions/models.py
View file @
8c194430
...
...
@@ -2,9 +2,9 @@ from django.db import models
from
django.core.urlresolvers
import
reverse
from
django.template.defaultfilters
import
truncatewords
from
taggit.managers
import
TaggableManager
from
representatives.models
import
Representative
class
Position
(
models
.
Model
):
representative
=
models
.
ForeignKey
(
Representative
,
related_name
=
'positions'
)
...
...
representatives_recommendations/contrib/dossier_mappings.py
0 → 100644
View file @
8c194430
# coding: utf-8
# flake8: noqa
dossier_mappings
=
{
"Resolution on Anti-Counterfeiting Trade Agreement (ACTA)"
:
"Resolution on the Anti-Counterfeiting Trade Agreement (ACTA)"
,
"Rapport Bono on cultural industries in Europe"
:
"Cultural industries in Europe"
,
"Rapport Gallo on enforcement of intellectual property rights in the internal market"
:
"Enforcement of intellectual property rights in the internal market"
,
"Rapport Lambrinidis on strengthening security and fundamental freedoms on the Internet"
:
"Strengthening security and fundamental freedoms on the Internet"
,
"Criminal measures aimed at ensuring the enforcement of intellectual property rights (IPRED 2), 1st reading"
:
"Criminal measures aimed at ensuring the enforcement of intellectual property rights"
}
representatives_recommendations/contrib/import_recommendations.py
View file @
8c194430
...
...
@@ -3,27 +3,15 @@
import
csv
import
django
from
django.apps
import
apps
from
django.db
import
transaction
import
logging
import
sys
from
representatives_recommendations.models
import
Recommendation
from
representatives_votes.models
import
Dossier
,
Proposal
logger
=
logging
.
getLogger
(
__name__
)
from
.dossier_mappings
import
dossier_mappings
dossier_mappings
=
{
"Resolution on Anti-Counterfeiting Trade Agreement (ACTA)"
:
"Resolution on the Anti-Counterfeiting Trade Agreement (ACTA)"
,
"Rapport Bono on cultural industries in Europe"
:
"Cultural industries in Europe"
,
"Rapport Gallo on enforcement of intellectual property rights in the internal market"
:
"Enforcement of intellectual property rights in the internal market"
,
"Rapport Lambrinidis on strengthening security and fundamental freedoms on the Internet"
:
"Strengthening security and fundamental freedoms on the Internet"
,
"Criminal measures aimed at ensuring the enforcement of intellectual property rights (IPRED 2), 1st reading"
:
"Criminal measures aimed at ensuring the enforcement of intellectual property rights"
}
logger
=
logging
.
getLogger
(
__name__
)
class
RecommendationImporter
:
...
...
@@ -124,4 +112,3 @@ def main(stream=None):
imported
=
imported
+
1
logger
.
info
(
'%d rows imported, %d rows rejected'
,
imported
,
len
(
rejected
))
setup.py
View file @
8c194430
...
...
@@ -44,8 +44,8 @@ setup(name='political-memory',
},
entry_points
=
{
'console_scripts'
:
[
'memopol_import_positions = representatives_positions.contrib.import_positions:main'
,
'memopol_import_recommendations = representatives_recommendations.contrib.import_recommendations:main'
,
'memopol_import_positions = representatives_positions.contrib.import_positions:main'
,
# noqa
'memopol_import_recommendations = representatives_recommendations.contrib.import_recommendations:main'
,
# noqa
]
}
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment