-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Catalog data into database, faster control select autocomplete (#…
…1673) * Move Catalog data into database, faster control select autocomplete Move control catalog data into database so catalogs shipped with GovReady and user added catalogs all accessed in database. Also faster reading in containers. Adjust first_run to load catalogs. Speed up auocomplete by only selecting matching controls. * Fix tests: add catalogs to db in setup * Read baselines from database * Sync with 0.9.7 * Fix tests * Fix tests 2 * Use better DB query instead of closure Co-authored-by: Greg Elin <greg.elin@govready.com>
- Loading branch information
1 parent
72a8846
commit 5a5513a
Showing
12 changed files
with
237 additions
and
202 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
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,33 @@ | ||
# Generated by Django 3.2.4 on 2021-08-05 02:12 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.manager | ||
import jsonfield.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('controls', '0056_element_oscal_version'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='CatalogData', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('catalog_key', models.CharField(help_text='Unique key for catalog', max_length=100, unique=True)), | ||
('catalog_json', jsonfield.fields.JSONField(blank=True, help_text='JSON object representing the OSCAL-formatted control catalog.', null=True)), | ||
('created', models.DateTimeField(auto_now_add=True, db_index=True)), | ||
('updated', models.DateTimeField(auto_now=True, db_index=True)), | ||
], | ||
options={ | ||
'abstract': False, | ||
'base_manager_name': 'prefetch_manager', | ||
}, | ||
managers=[ | ||
('objects', django.db.models.manager.Manager()), | ||
('prefetch_manager', django.db.models.manager.Manager()), | ||
], | ||
), | ||
] |
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 3.2.4 on 2021-08-05 15:19 | ||
|
||
from django.db import migrations | ||
import jsonfield.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('controls', '0057_catalogdata'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='catalogdata', | ||
name='baselines_json', | ||
field=jsonfield.fields.JSONField(blank=True, help_text='JSON object representing the baselines for the catalog.', null=True), | ||
), | ||
] |
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.