Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

delorean/domain.py

  • Loading branch information...
commit ae3d35ff31bb042fcea495b9efff8bf3a161b57c 1 parent 16d8684
fabiobatalha authored
View
1  .gitignore
@@ -1,3 +1,4 @@
+runtests.sh
*.egg-info/
*-env/
*.pyc
View
4 delorean/domain.py
@@ -356,10 +356,6 @@ def get_data(self, obj):
obj['creator'] = self._lookup_field('users', userid, 'username')
- # lookup publisher
- pubid = obj['publisher'].strip('/').split('/')[-1]
- obj['publisher'] = self._lookup_field('publishers', pubid, 'name')
-
# lookup sponsors
sponsors = []
for sponsor in obj['sponsors']:
View
24 delorean/templates/title_db_entry.txt
@@ -46,12 +46,12 @@
!v062!${copyrighter}
% endif
##
-% if address is not UNDEFINED and address:
-!v063!${address}
+% if editor_address is not UNDEFINED and editor_address:
+!v063!${editor_address}
% endif
##
-% if contact is not UNDEFINED and contact:
-!v064!${contact['email']}
+% if editor_email is not UNDEFINED and editor_email:
+!v064!${editor_email}
% endif
##
!v066!art
@@ -126,6 +126,14 @@
!v306!${final_num}
% endif
##
+% if publisher_country is not UNDEFINED and publisher_country:
+!v310!${publisher_country}
+% endif
+##
+% if publisher_state is not UNDEFINED and publisher_state:
+!v320!${publisher_state}
+% endif
+##
% if pub_level is not UNDEFINED and pub_level:
!v330!${pub_level}
% endif
@@ -172,8 +180,12 @@
% endfor
% endif
##
-% if publisher is not UNDEFINED and publisher:
-!v480!${publisher}
+% if publisher_name is not UNDEFINED and publisher_name:
+!v480!${publisher_name}
+% endif
+##
+% if publication_city is not UNDEFINED and publication_city:
+!v490!${publication_city}
% endif
##
% if use_license is not UNDEFINED and use_license:
View
12 delorean/tests.py
@@ -171,7 +171,6 @@ def test_get_data(self):
dummy_slumber = self.mocker.mock()
dummy_journal = self.mocker.mock()
dummy_user = self.mocker.mock()
- dummy_publisher = self.mocker.mock()
dummy_sponsor = self.mocker.mock()
dummy_slumber.API(ANY)
@@ -193,17 +192,6 @@ def test_get_data(self):
}
)
- dummy_slumber.publishers(ANY)
- self.mocker.result(dummy_publisher)
-
- dummy_publisher.get()
- self.mocker.result(
- {
- 'name': 'Colégio Brasileiro de Cirurgia Digestiva',
- 'city': 'São Paulo'
- }
- )
-
dummy_slumber.sponsors(ANY)
self.mocker.result(dummy_sponsor)
View
3  delorean/tests_assets/journal_meta.id
@@ -25,6 +25,8 @@
!v301!1986
!v302!1
!v303!1
+!v310!BR
+!v320!SP
!v330!CT
!v350!en
!v350!pt
@@ -39,6 +41,7 @@
!v441!Health Sciences
!v450!LL - LILACS
!v480!Col�gio Brasileiro de Cirurgia Digestiva
+!v490!S�o Paulo
!v540!^tLicencia Creative Commons^len
!v540!^tLicencia Creative Commons^les
!v540!^tLicencia Creative Commons^lpt
View
14 delorean/tests_assets/journal_meta_afterproc.json
@@ -35,7 +35,10 @@
"init_year": "1986",
"other_previous_title": "",
"init_num": "1",
- "publisher": "Colégio Brasileiro de Cirurgia Digestiva",
+ "publisher_name": "Colégio Brasileiro de Cirurgia Digestiva",
+ "publisher_state": "SP",
+ "publisher_country": "BR",
+ "publication_city": "São Paulo",
"pub_level": "CT",
"final_vol": "",
"cover": null,
@@ -78,12 +81,9 @@
"Publicar art\u00edculos de estudios cl\u00ednicos y experimentales que aporten para el desarrollo de la pesquisa, ense\u00f1anza y asistencia en el \u00e1rea gastroenterolog\u00eda quir\u00fargica, cl\u00ednica, endosc\u00f3pica y otras correlacionadas."
]
],
- "address": "Av. Brigadeiro Luiz Antonio, 278 - 6° - Salas 10 e 11 01318-901 São Paulo/SP Brasil Tel.: (11) 3288-8174/3289-0741",
- "email": "cbcd@cbcd.org.br",
+ "editor_address": "Av. Brigadeiro Luiz Antonio, 278 - 6° - Salas 10 e 11 01318-901 São Paulo/SP Brasil Tel.: (11) 3288-8174/3289-0741",
+ "editor_email": "cbcd@cbcd.org.br",
"study_areas": ["Health Sciences"],
- "contact": {
- "email": "cbcd@cbcd.org.br",
- "name": "Col\u00e9gio Brasileiro de Cirurgia Digestiva"
- },
+ "contact": null,
"updated": "20120706"
}
View
13 delorean/tests_assets/journal_meta_beforeproc.json
@@ -7,6 +7,7 @@
"collections": [
"/api/v1/collections/1/"
],
+ "contact": null,
"copyrighter": "Colégio Brasileiro de Cirurgia Digestiva - CBCD",
"cover": null,
"created": "2012-07-05T11:36:07.680706",
@@ -76,7 +77,10 @@
"pub_level": "CT",
"pub_status": "current",
"pub_status_reason": "",
- "publisher": "/api/v1/publishers/1/",
+ "publisher_name": "Colégio Brasileiro de Cirurgia Digestiva",
+ "publisher_state": "SP",
+ "publisher_country": "BR",
+ "publication_city": "São Paulo",
"resource_uri": "/api/v1/journals/1/",
"scielo_issn": "print",
"secs_code": "6633",
@@ -96,12 +100,9 @@
{"date": "2008-08-01T00:00:00", "status": "suspended"},
{"date": "1998-04-30T00:00:00", "status": "current"}
],
- "contact": {
- "email": "cbcd@cbcd.org.br",
- "name": "Col\u00e9gio Brasileiro de Cirurgia Digestiva"
- },
"study_areas": ["Health Sciences"],
- "address": "Av. Brigadeiro Luiz Antonio, 278 - 6° - Salas 10 e 11 01318-901 São Paulo/SP Brasil Tel.: (11) 3288-8174/3289-0741",
+ "editor_address": "Av. Brigadeiro Luiz Antonio, 278 - 6° - Salas 10 e 11 01318-901 São Paulo/SP Brasil Tel.: (11) 3288-8174/3289-0741",
+ "editor_email": "cbcd@cbcd.org.br",
"use_license": {
"disclaimer": "Licencia Creative Commons",
"id": "1",
View
2  runtests.sh
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
-~/prj/envs/delorean/bin/nosetests --cover-package=delorean --cover-erase --with-coverage
+~/Trabalho/delorean/delorean-env/bin/nosetests --cover-package=delorean --cover-erase --with-coverage
Please sign in to comment.
Something went wrong with that request. Please try again.