-
Notifications
You must be signed in to change notification settings - Fork 9
Add external source fields in event #2760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Generated by Django 5.2.14 on 2026-06-10 04:46 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('api', '0231_alter_export_export_type'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name='event', | ||
| name='auto_generated_external_source', | ||
| field=models.CharField(blank=True, help_text='External source or system from which the original event data originated.', max_length=100, null=True, verbose_name='external source'), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='event', | ||
| name='auto_generated_external_source_id', | ||
| field=models.CharField(blank=True, help_text='Unique identifier of the event record in the external source system.', max_length=100, null=True, verbose_name='external source ID'), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='fieldreport', | ||
| name='external_source', | ||
| field=models.CharField(blank=True, help_text='External source system from which this field report created.', max_length=100, null=True, verbose_name='external source'), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='fieldreport', | ||
| name='external_source_id', | ||
| field=models.CharField(blank=True, help_text='Unique identifier of this field report in the external source system.', max_length=100, null=True, verbose_name='external source ID'), | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -828,7 +828,22 @@ class Event(models.Model): | |
| auto_generated_source = models.CharField( | ||
| verbose_name=_("auto generated source"), max_length=50, null=True, blank=True, editable=False | ||
| ) | ||
|
|
||
| # External system or source from which the event data originated | ||
| auto_generated_external_source = models.CharField( | ||
| verbose_name=_("external source"), | ||
| max_length=100, | ||
| null=True, | ||
| blank=True, | ||
| help_text=_("External source or system from which the original event data originated."), | ||
| ) | ||
| # Identifier of the originating event record in the external system | ||
| auto_generated_external_source_id = models.CharField( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason for using CharField here? This looks like it should be a UUID field. If this value is always expected to be a UUID, would it be possible to use a UUIDField instead? That would provide built-in validation.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the MRCS site, we are not using UUIDs for the id field. If it’s coming externally as a UUID, we can switch to a UUIDField. @frozenhelium can you also confirm this?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct! |
||
| verbose_name=_("external source ID"), | ||
| max_length=100, | ||
| null=True, | ||
| blank=True, | ||
| help_text=_("Unique identifier of the event record in the external source system."), | ||
| ) | ||
| # Meant to give the organization a way of highlighting certain, important events. | ||
| is_featured = models.BooleanField(default=False, verbose_name=_("is featured on home page")) | ||
|
|
||
|
|
@@ -2473,7 +2488,22 @@ class RecentAffected(models.IntegerChoices): | |
| default=0, | ||
| help_text='<a target="_blank" href="/api/v2/recentaffected">Key/value pairs</a>', | ||
| ) | ||
|
|
||
| # External system from which this Field Report created. | ||
| external_source = models.CharField( | ||
| verbose_name=_("external source"), | ||
| max_length=100, | ||
| null=True, | ||
| blank=True, | ||
| help_text=_("External source system from which this field report created."), | ||
| ) | ||
| # Identifier of the report in the external system. | ||
| external_source_id = models.CharField( | ||
| verbose_name=_("external source ID"), | ||
| max_length=100, | ||
| null=True, | ||
| blank=True, | ||
| help_text=_("Unique identifier of this field report in the external source system."), | ||
| ) | ||
| # start_date is now what the user explicitly sets while filling the Field Report form. | ||
| start_date = models.DateTimeField(verbose_name=_("start date"), blank=True, null=True) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we even need these fields here in the event table? Do we need filtering for this features?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we may need these for filtering in the future. @frozenhelium , can you also confirm this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct!