Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Oznaczanie rekordów w zewnętrznych bazach danych
Framework umożliwiający dopisywanie dowolnych zewnętrznych baz danych i tagowanie rekordów, które w nich są, z opcjonalną informacją. Obecnie zaimplementowany dla wydawnictw ciągłych. Uwaga: oznaczanie konferencji w bazach Scopus/WOS pozostaje bez zmian. W sytuacji, gdyby dla konferencji potrzebny był większy zakres baz danych (podytkowany wytycznymi PBN), warto by było również dla konferencji zaimplementować takie „tagowanie”. Na ten moment konferencje pozostają tj są.
- Loading branch information
1 parent
a0888e4
commit 4827b67
Showing
18 changed files
with
280 additions
and
28 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
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 |
---|---|---|
|
@@ -25,5 +25,5 @@ class Meta: | |
|
||
class NagrodaInline(GenericTabularInline): | ||
model = Nagroda | ||
extra = 0 | ||
extra = 1 | ||
form = NagrodaForm |
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.12 on 2018-04-16 08:51 | ||
from __future__ import unicode_literals | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
def domyslne_bazy(apps, schema_editor): | ||
Zewnetrzna_Baza_Danych = apps.get_model("bpp", "Zewnetrzna_Baza_Danych") | ||
for nazwa, skrot in [ | ||
("Web of Science", "WOS"), | ||
("Scopus", "SCOPUS")]: | ||
Zewnetrzna_Baza_Danych.objects.create( | ||
nazwa=nazwa, skrot=skrot | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
('bpp', '0125_auto_20180415_2223'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Wydawnictwo_Ciagle_Zewnetrzna_Baza_Danych', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('info', models.CharField(blank=True, max_length=512, null=True)), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='Zewnetrzna_Baza_Danych', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('nazwa', models.CharField(max_length=512, unique=True)), | ||
('skrot', models.CharField(max_length=128, unique=True)), | ||
], | ||
options={ | ||
'verbose_name': 'zewnętrzna baza danych', | ||
'verbose_name_plural': 'zenwętrzne bazy danych', | ||
'ordering': ['nazwa'], | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name='wydawnictwo_ciagle_zewnetrzna_baza_danych', | ||
name='baza', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bpp.Zewnetrzna_Baza_Danych'), | ||
), | ||
migrations.AddField( | ||
model_name='wydawnictwo_ciagle_zewnetrzna_baza_danych', | ||
name='rekord', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bpp.Wydawnictwo_Ciagle'), | ||
), | ||
|
||
migrations.RunPython( | ||
domyslne_bazy, | ||
migrations.RunPython.noop | ||
) | ||
] |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.12 on 2018-04-16 11:03 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bpp', '0126_zewnetrzna_baza_danych'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='wydawnictwo_ciagle_zewnetrzna_baza_danych', | ||
options={'verbose_name': 'powiązanie wydawnictwa ciągłego z zewnętrznymi bazami danych', 'verbose_name_plural': 'powiązania wydawnictw ciągłych z zewnętrznymi bazami danych'}, | ||
), | ||
migrations.AlterField( | ||
model_name='wydawnictwo_ciagle_zewnetrzna_baza_danych', | ||
name='info', | ||
field=models.CharField(blank=True, max_length=512, null=True, verbose_name='Informacje dodatkowe'), | ||
), | ||
] |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.12 on 2018-04-16 11:03 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
from bpp.migration_util import load_custom_sql | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bpp', '0127_auto_20180416_1303'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython( | ||
lambda *args, **kw: load_custom_sql("0128_zewnetrzne_bazy_view", *args, **kw) | ||
), | ||
] |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
BEGIN; | ||
|
||
CREATE OR REPLACE VIEW bpp_zewnetrzne_bazy_wydawnictwo_ciagle_view AS | ||
SELECT | ||
ARRAY [ | ||
(SELECT id | ||
FROM django_content_type | ||
WHERE | ||
django_content_type.app_label = 'bpp' AND | ||
django_content_type.model = 'wydawnictwo_ciagle'), | ||
bpp_wydawnictwo_ciagle_zewnetrzna_baza_danych.rekord_id | ||
] :: INTEGER [2] AS rekord_id, | ||
|
||
baza_id, | ||
INFO | ||
|
||
FROM bpp_wydawnictwo_ciagle_zewnetrzna_baza_danych; | ||
|
||
|
||
CREATE OR REPLACE VIEW bpp_zewnetrzne_bazy_view AS | ||
|
||
SELECT * | ||
FROM bpp_zewnetrzne_bazy_wydawnictwo_ciagle_view; | ||
|
||
COMMIT; |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.12 on 2018-04-16 11:13 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bpp', '0128_zewnetrzne_bazy_view'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ZewnetrzneBazyDanychView', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('info', models.TextField()), | ||
], | ||
options={ | ||
'db_table': 'bpp_zewnetrzne_bazy_view', | ||
'managed': False, | ||
}, | ||
), | ||
] |
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.