-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
2,781 additions
and
88 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,5 @@ __pycache__ | |
/postgresqldata_test | ||
.env | ||
|
||
/.idea | ||
/.idea | ||
/backend/old_database_dump |
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 |
---|---|---|
@@ -1,16 +1,24 @@ | ||
from django.contrib import admin | ||
|
||
from administration_units.models import OrganizingUnit, BrontosaurusMovement | ||
from administration_units.models import AdministrationUnit, BrontosaurusMovement | ||
from bis.admin_helpers import EditableByAdminOnlyMixin | ||
|
||
|
||
@admin.register(OrganizingUnit) | ||
class OrganizingUnitAdmin(EditableByAdminOnlyMixin, admin.ModelAdmin): | ||
@admin.register(AdministrationUnit) | ||
class AdministrationUnitAdmin(EditableByAdminOnlyMixin, admin.ModelAdmin): | ||
list_display = 'name', | ||
search_fields = 'name', | ||
filter_horizontal = 'board_members', | ||
|
||
autocomplete_fields = 'chairman', 'manager', 'board_members' | ||
|
||
exclude = '_import_id', | ||
|
||
|
||
@admin.register(BrontosaurusMovement) | ||
class BrontosaurusMovementAdmin(EditableByAdminOnlyMixin, admin.ModelAdmin): | ||
filter_horizontal = 'bis_administrators', 'office_workers', 'audit_committee', 'executive_committee', 'education_members', | ||
filter_horizontal = 'bis_administrators', 'office_workers', 'audit_committee', \ | ||
'executive_committee', 'education_members', | ||
|
||
autocomplete_fields = 'director', 'bis_administrators', 'office_workers', 'audit_committee', \ | ||
'executive_committee', 'education_members' |
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,41 @@ | ||
# Generated by Django 4.0.3 on 2022-03-23 15:35 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='AdministrationUnit', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=63)), | ||
], | ||
options={ | ||
'ordering': ('id',), | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='AdministrationUnitMember', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('since', models.DateTimeField()), | ||
('till', models.DateTimeField()), | ||
], | ||
options={ | ||
'ordering': ('id',), | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='BrontosaurusMovement', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
], | ||
), | ||
] |
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,84 @@ | ||
# Generated by Django 4.0.3 on 2022-03-23 15:35 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('categories', '0001_initial'), | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('administration_units', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='brontosaurusmovement', | ||
name='audit_committee', | ||
field=models.ManyToManyField(related_name='+', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='brontosaurusmovement', | ||
name='bis_administrators', | ||
field=models.ManyToManyField(related_name='+', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='brontosaurusmovement', | ||
name='director', | ||
field=models.ForeignKey(help_text='Má veškerá oprávnění', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='brontosaurusmovement', | ||
name='education_members', | ||
field=models.ManyToManyField(related_name='+', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='brontosaurusmovement', | ||
name='executive_committee', | ||
field=models.ManyToManyField(related_name='+', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='brontosaurusmovement', | ||
name='office_workers', | ||
field=models.ManyToManyField(related_name='+', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='administrationunitmember', | ||
name='administration_unit', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='administration_units.administrationunit'), | ||
), | ||
migrations.AddField( | ||
model_name='administrationunitmember', | ||
name='category', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='categories.administrationunitboardmembercategory'), | ||
), | ||
migrations.AddField( | ||
model_name='administrationunitmember', | ||
name='user', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='administrationunit', | ||
name='board_members', | ||
field=models.ManyToManyField(related_name='administration_units', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='administrationunit', | ||
name='category', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='administration_units', to='categories.administrationunitcategory'), | ||
), | ||
migrations.AddField( | ||
model_name='administrationunit', | ||
name='chairman', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AddField( | ||
model_name='administrationunit', | ||
name='manager', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to=settings.AUTH_USER_MODEL), | ||
), | ||
] |
77 changes: 77 additions & 0 deletions
77
backend/administration_units/migrations/0003_administrationunit_abbreviation_and_more.py
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,77 @@ | ||
# Generated by Django 4.0.3 on 2022-05-09 16:01 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import phonenumber_field.modelfields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('administration_units', '0002_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='administrationunit', | ||
name='abbreviation', | ||
field=models.CharField(default='', max_length=63), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name='administrationunit', | ||
name='email', | ||
field=models.EmailField(max_length=254, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='administrationunit', | ||
name='existed_since', | ||
field=models.DateField(null=True), | ||
), | ||
migrations.AddField( | ||
model_name='administrationunit', | ||
name='existed_till', | ||
field=models.DateField(blank=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='administrationunit', | ||
name='is_for_kids', | ||
field=models.BooleanField(default=False), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name='administrationunit', | ||
name='phone', | ||
field=phonenumber_field.modelfields.PhoneNumberField(max_length=128, null=True, region=None), | ||
), | ||
migrations.AddField( | ||
model_name='administrationunit', | ||
name='www', | ||
field=models.URLField(null=True), | ||
), | ||
migrations.AlterField( | ||
model_name='administrationunit', | ||
name='chairman', | ||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.AlterField( | ||
model_name='administrationunit', | ||
name='manager', | ||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to=settings.AUTH_USER_MODEL), | ||
), | ||
migrations.CreateModel( | ||
name='AdministrationUnitAddress', | ||
fields=[ | ||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('street', models.CharField(max_length=127)), | ||
('city', models.CharField(max_length=63)), | ||
('zip_code', models.CharField(max_length=5)), | ||
('administration_unit', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='address', to='administration_units.administrationunit')), | ||
], | ||
options={ | ||
'ordering': ('id',), | ||
}, | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
backend/administration_units/migrations/0004_alter_administrationunit_name.py
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,18 @@ | ||
# Generated by Django 4.0.3 on 2022-05-09 16:09 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('administration_units', '0003_administrationunit_abbreviation_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='administrationunit', | ||
name='name', | ||
field=models.CharField(max_length=255), | ||
), | ||
] |
23 changes: 23 additions & 0 deletions
23
...d/administration_units/migrations/0005_administrationunit_bank_account_number_and_more.py
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,23 @@ | ||
# Generated by Django 4.0.3 on 2022-05-09 16:55 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('administration_units', '0004_alter_administrationunit_name'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='administrationunit', | ||
name='bank_account_number', | ||
field=models.CharField(blank=True, max_length=63, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='administrationunit', | ||
name='ic', | ||
field=models.CharField(max_length=7, null=True), | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
backend/administration_units/migrations/0006_alter_administrationunit_ic.py
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,18 @@ | ||
# Generated by Django 4.0.3 on 2022-05-09 17:06 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('administration_units', '0005_administrationunit_bank_account_number_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='administrationunit', | ||
name='ic', | ||
field=models.CharField(max_length=15, null=True), | ||
), | ||
] |
19 changes: 19 additions & 0 deletions
19
backend/administration_units/migrations/0007_administrationunit_import_id.py
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,19 @@ | ||
# Generated by Django 4.0.3 on 2022-05-11 09:42 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('administration_units', '0006_alter_administrationunit_ic'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='administrationunit', | ||
name='import_id', | ||
field=models.CharField(default='', max_length=15), | ||
preserve_default=False, | ||
), | ||
] |
22 changes: 22 additions & 0 deletions
22
backend/administration_units/migrations/0008_remove_administrationunit_import_id_and_more.py
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,22 @@ | ||
# Generated by Django 4.0.3 on 2022-05-12 07:21 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('administration_units', '0007_administrationunit_import_id'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='administrationunit', | ||
name='import_id', | ||
), | ||
migrations.AddField( | ||
model_name='administrationunit', | ||
name='_import_id', | ||
field=models.CharField(default='', max_length=15), | ||
), | ||
] |
Oops, something went wrong.