Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
memopol
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
32
Issues
32
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Political Memory
memopol
Commits
8c194430
Commit
8c194430
authored
May 30, 2016
by
Nicolas Joyard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test errors
parent
98a0fae0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
20 deletions
+20
-20
representatives_positions/contrib/import_positions.py
representatives_positions/contrib/import_positions.py
+0
-2
representatives_positions/models.py
representatives_positions/models.py
+1
-1
representatives_recommendations/contrib/dossier_mappings.py
representatives_recommendations/contrib/dossier_mappings.py
+15
-0
representatives_recommendations/contrib/import_recommendations.py
...tatives_recommendations/contrib/import_recommendations.py
+2
-15
setup.py
setup.py
+2
-2
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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