-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from open-zaak/feature/optimize_db_quieries_i…
…nformatieobject_related optimize db queries - part 2 (Infromatieobject related)
- Loading branch information
Showing
6 changed files
with
62 additions
and
5 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
21 changes: 21 additions & 0 deletions
21
src/openzaak/components/documenten/migrations/0009_auto_20191107_1028.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,21 @@ | ||
# Generated by Django 2.2.4 on 2019-11-07 10:28 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("documenten", "0008_auto_20191104_1644"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name="enkelvoudiginformatieobject", | ||
options={ | ||
"ordering": ["canonical", "-versie"], | ||
"verbose_name": "Enkelvoudige informatie object", | ||
"verbose_name_plural": "Enkelvoudige informatie objecten", | ||
}, | ||
), | ||
] |
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
16 changes: 16 additions & 0 deletions
16
src/openzaak/components/documenten/tests/models/test_last_version.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,16 @@ | ||
from django.test import TestCase | ||
|
||
from ..factories import ( | ||
EnkelvoudigInformatieObjectCanonicalFactory, | ||
EnkelvoudigInformatieObjectFactory, | ||
) | ||
|
||
|
||
class LastVersionTests(TestCase): | ||
def test_canonical_last_version(self): | ||
canonical = EnkelvoudigInformatieObjectCanonicalFactory() | ||
eio1 = EnkelvoudigInformatieObjectFactory.create(canonical=canonical, versie=1) | ||
eio2 = EnkelvoudigInformatieObjectFactory.create(canonical=canonical, versie=2) | ||
eio3 = EnkelvoudigInformatieObjectFactory.create(canonical=canonical, versie=3) | ||
|
||
self.assertEqual(canonical.latest_version, eio3) |
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