diff --git a/app/admin_ui/tables/published.py b/app/admin_ui/tables/published.py index f2dd0e47..dbb68f9c 100644 --- a/app/admin_ui/tables/published.py +++ b/app/admin_ui/tables/published.py @@ -29,7 +29,7 @@ WebsiteType, ) -from .tables import ConditionalValueColumn, ShortNamefromUUIDColumn +from .tables import BackupValueColumn, ShortNamefromUUIDColumn class LimitedTableBase(tables.Table): @@ -46,7 +46,7 @@ class Meta: class IOPPublishedTable(tables.Table): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('IOP')), @@ -70,7 +70,7 @@ class Meta(LimitedTableBase.Meta): class SignificantEventPublishedTable(tables.Table): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('SignificantEvent')), @@ -123,7 +123,7 @@ class Meta(LimitedTableBase.Meta): class DOIPublishedTable(tables.Table): - concept_id = ConditionalValueColumn( + concept_id = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('DOI')), @@ -154,7 +154,7 @@ class Meta(LimitedTableBase.Meta): class DeploymentPublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('Deployment')), @@ -176,7 +176,7 @@ class Meta(LimitedTableBase.Meta): class PlatformTypePublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('PlatformType')), @@ -193,7 +193,7 @@ class Meta(LimitedTableBase.Meta): class MeasurementTypePublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('MeasurementType')), @@ -210,7 +210,7 @@ class Meta(LimitedTableBase.Meta): class MeasurementStylePublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('MeasurementStyle')), @@ -227,7 +227,7 @@ class Meta(LimitedTableBase.Meta): class HomeBasePublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('HomeBase')), @@ -244,7 +244,7 @@ class Meta(LimitedTableBase.Meta): class FocusAreaPublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('FocusArea')), @@ -261,7 +261,7 @@ class Meta(LimitedTableBase.Meta): class SeasonPublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('Season')), @@ -278,7 +278,7 @@ class Meta(LimitedTableBase.Meta): class RepositoryPublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('Repository')), @@ -295,7 +295,7 @@ class Meta(LimitedTableBase.Meta): class MeasurementRegionPublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('MeasurementRegion')), @@ -315,7 +315,7 @@ class Meta(LimitedTableBase.Meta): class GeographicalRegionPublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('GeographicalRegion')), @@ -332,7 +332,7 @@ class Meta(LimitedTableBase.Meta): class GeophysicalConceptPublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('GeophysicalConcept')), @@ -349,7 +349,7 @@ class Meta(LimitedTableBase.Meta): class PartnerOrgPublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('PartnerOrg')), @@ -366,7 +366,7 @@ class Meta(LimitedTableBase.Meta): class WebsiteTypePublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('WebsiteType')), @@ -383,7 +383,7 @@ class Meta(LimitedTableBase.Meta): class CampaignPublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('Campaign')), @@ -400,7 +400,7 @@ class Meta(LimitedTableBase.Meta): class PlatformPublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('Platform')), @@ -417,7 +417,7 @@ class Meta(LimitedTableBase.Meta): class InstrumentPublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('Instrument')), @@ -434,7 +434,7 @@ class Meta(LimitedTableBase.Meta): class WebsitePublishedTable(tables.Table): - title = ConditionalValueColumn( + title = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('Website')), @@ -452,7 +452,7 @@ class Meta(LimitedTableBase.Meta): class AliasPublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('Alias')), @@ -470,7 +470,7 @@ class Meta(LimitedTableBase.Meta): class GcmdProjectPublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('GcmdProject')), @@ -487,7 +487,7 @@ class Meta(LimitedTableBase.Meta): class GcmdInstrumentPublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('GcmdInstrument')), @@ -518,7 +518,7 @@ class Meta(LimitedTableBase.Meta): class GcmdPlatformPublishedTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('GcmdPlatform')), @@ -535,7 +535,7 @@ class Meta(LimitedTableBase.Meta): class GcmdPhenomenonPublishedTable(tables.Table): - variable_3 = ConditionalValueColumn( + variable_3 = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('GcmdPhenomenon')), @@ -556,7 +556,7 @@ class Meta(LimitedTableBase.Meta): class ImagePublishedTable(tables.Table): - title = ConditionalValueColumn( + title = BackupValueColumn( linkify=( "published-detail", dict(canonical_uuid=tables.A("uuid"), model=camel_to_snake('Image')), diff --git a/app/admin_ui/tables/tables.py b/app/admin_ui/tables/tables.py index e1db09b4..72821288 100644 --- a/app/admin_ui/tables/tables.py +++ b/app/admin_ui/tables/tables.py @@ -18,10 +18,10 @@ from api_app.models import ApprovalLog -class ConditionalValueColumn(tables.Column): - def __init__(self, update_accessor=None, **kwargs): +class BackupValueColumn(tables.Column): + def __init__(self, backup_accessor=None, **kwargs): super().__init__(**kwargs, empty_values=()) - self.update_accessor = update_accessor + self.backup_accessor = backup_accessor def _get_processed_value(self, value): if value.__class__.__name__ == "ManyRelatedManager": @@ -46,10 +46,10 @@ def get_backup_value(self, **kwargs): # This is being called from published tables as well. Which doesn't come with a record with action attribute if ( not value - and self.update_accessor + and self.backup_accessor and getattr(record, "action", None) != Change.Actions.CREATE ): - accessor = A(self.update_accessor) + accessor = A(self.backup_accessor) value = self._get_processed_value(accessor.resolve(record)) return value @@ -69,7 +69,7 @@ def render(self, **kwargs): return value or "---" -class ShortNamefromUUIDColumn(ConditionalValueColumn): +class ShortNamefromUUIDColumn(BackupValueColumn): def __init__(self, model=None, **kwargs): super().__init__(**kwargs) self.model = model @@ -187,16 +187,16 @@ def render_status(self, value, record): class LimitedTableBase(DraftTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( verbose_name="Short Name", accessor="update__short_name", - update_accessor="content_object.short_name", + backup_accessor="content_object.short_name", linkify=("change-update", [tables.A("uuid")]), ) - long_name = ConditionalValueColumn( + long_name = BackupValueColumn( verbose_name="Long Name", accessor="latest_update__long_name", - update_accessor="content_object.long_name", + backup_accessor="content_object.long_name", ) initial_fields = ("short_name", "long_name") @@ -207,27 +207,27 @@ class Meta(DraftTableBase.Meta): class IOPChangeListTable(DraftTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( verbose_name="Short Name", accessor="update__short_name", - update_accessor="content_object.short_name", + backup_accessor="content_object.short_name", linkify=("change-update", [tables.A("uuid")]), ) deployment = ShortNamefromUUIDColumn( verbose_name="Deployment", model=Deployment, accessor="update__deployment", - update_accessor="content_object.deployment", + backup_accessor="content_object.deployment", ) - start_date = ConditionalValueColumn( + start_date = BackupValueColumn( verbose_name="Start Date", accessor="update__start_date", - update_accessor="content_object.start_date", + backup_accessor="content_object.start_date", ) - end_date = ConditionalValueColumn( + end_date = BackupValueColumn( verbose_name="End Date", accessor="update__end_date", - update_accessor="content_object.end_date", + backup_accessor="content_object.end_date", ) class Meta(DraftTableBase.Meta): @@ -242,27 +242,27 @@ class Meta(DraftTableBase.Meta): class SignificantEventChangeListTable(DraftTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( verbose_name="Short Name", accessor="update__short_name", - update_accessor="content_object.short_name", + backup_accessor="content_object.short_name", linkify=("change-update", [tables.A("uuid")]), ) deployment = ShortNamefromUUIDColumn( verbose_name="Deployment", model=Deployment, accessor="update__deployment", - update_accessor="content_object.deployment", + backup_accessor="content_object.deployment", ) - start_date = ConditionalValueColumn( + start_date = BackupValueColumn( verbose_name="Start Date", accessor="update__start_date", - update_accessor="content_object.start_date", + backup_accessor="content_object.start_date", ) - end_date = ConditionalValueColumn( + end_date = BackupValueColumn( verbose_name="End Date", accessor="update__end_date", - update_accessor="content_object.end_date", + backup_accessor="content_object.end_date", ) class Meta(DraftTableBase.Meta): @@ -283,20 +283,20 @@ class CollectionPeriodChangeListTable(DraftTableBase): model=Deployment, verbose_name="Deployment", accessor="update__deployment", - update_accessor="content_object.deployment", + backup_accessor="content_object.deployment", ) platform = ShortNamefromUUIDColumn( verbose_name="Platform", model=Platform, accessor="update__platform", - update_accessor="content_object.platform", + backup_accessor="content_object.platform", ) instruments = ShortNamefromUUIDColumn( verbose_name="Instruments", model=Instrument, accessor="update__instruments", - update_accessor="content_object.instruments", + backup_accessor="content_object.instruments", ) class Meta(DraftTableBase.Meta): @@ -306,34 +306,34 @@ class Meta(DraftTableBase.Meta): class DOIChangeListTable(DraftTableBase): - concept_id = ConditionalValueColumn( + concept_id = BackupValueColumn( verbose_name="Concept ID", accessor="update__concept_id", - update_accessor="content_object.concept_id", + backup_accessor="content_object.concept_id", linkify=("change-update", [tables.A("uuid")]), ) - long_name = ConditionalValueColumn( + long_name = BackupValueColumn( verbose_name="Long Name", accessor="update__long_name", - update_accessor="content_object.long_name", + backup_accessor="content_object.long_name", ) campaigns = ShortNamefromUUIDColumn( verbose_name="Campaigns", model=Campaign, accessor="update__campaigns", - update_accessor="content_object.campaigns", + backup_accessor="content_object.campaigns", ) platforms = ShortNamefromUUIDColumn( verbose_name="Platforms", model=Platform, accessor="update__platforms", - update_accessor="content_object.platforms", + backup_accessor="content_object.platforms", ) instruments = ShortNamefromUUIDColumn( verbose_name="Instruments", model=Instrument, accessor="update__instruments", - update_accessor="content_object.instruments", + backup_accessor="content_object.instruments", ) class Meta(DraftTableBase.Meta): @@ -353,17 +353,17 @@ class DeploymentChangeListTable(LimitedTableBase): verbose_name="Campaign", model=Campaign, accessor="update__campaign", - update_accessor="content_object.campaign", + backup_accessor="content_object.campaign", ) - start_date = ConditionalValueColumn( + start_date = BackupValueColumn( verbose_name="Start Date", accessor="update__start_date", - update_accessor="content_object.start_date", + backup_accessor="content_object.start_date", ) - end_date = ConditionalValueColumn( + end_date = BackupValueColumn( verbose_name="End Date", accessor="update__end_date", - update_accessor="content_object.end_date", + backup_accessor="content_object.end_date", ) class Meta(LimitedTableBase.Meta): @@ -377,8 +377,8 @@ class Meta(LimitedTableBase.Meta): class PlatformTypeChangeListTable(LimitedTableBase): - parent = ConditionalValueColumn( - verbose_name="Parent", accessor="update__parent", update_accessor="content_object.parent" + parent = BackupValueColumn( + verbose_name="Parent", accessor="update__parent", backup_accessor="content_object.parent" ) class Meta(LimitedTableBase.Meta): @@ -388,8 +388,8 @@ class Meta(LimitedTableBase.Meta): class MeasurementTypeChangeListTable(LimitedTableBase): - parent = ConditionalValueColumn( - verbose_name="Parent", accessor="update__parent", update_accessor="content_object.parent" + parent = BackupValueColumn( + verbose_name="Parent", accessor="update__parent", backup_accessor="content_object.parent" ) class Meta(LimitedTableBase.Meta): @@ -399,8 +399,8 @@ class Meta(LimitedTableBase.Meta): class MeasurementStyleChangeListTable(LimitedTableBase): - parent = ConditionalValueColumn( - verbose_name="Parent", accessor="update__parent", update_accessor="content_object.parent" + parent = BackupValueColumn( + verbose_name="Parent", accessor="update__parent", backup_accessor="content_object.parent" ) class Meta(LimitedTableBase.Meta): @@ -410,10 +410,10 @@ class Meta(LimitedTableBase.Meta): class HomeBaseChangeListTable(LimitedTableBase): - location = ConditionalValueColumn( + location = BackupValueColumn( verbose_name="Location", accessor="update__location", - update_accessor="content_object.location", + backup_accessor="content_object.location", ) class Meta(LimitedTableBase.Meta): @@ -423,8 +423,8 @@ class Meta(LimitedTableBase.Meta): class FocusAreaChangeListTable(LimitedTableBase): - url = ConditionalValueColumn( - verbose_name="Url", accessor="update__url", update_accessor="content_object.url" + url = BackupValueColumn( + verbose_name="Url", accessor="update__url", backup_accessor="content_object.url" ) class Meta(LimitedTableBase.Meta): @@ -441,10 +441,10 @@ class Meta(LimitedTableBase.Meta): class RepositoryChangeListTable(LimitedTableBase): - gcmd_uuid = ConditionalValueColumn( + gcmd_uuid = BackupValueColumn( verbose_name="GCMD UUID", accessor="update__gcmd_uuid", - update_accessor="content_object.gcmd_uuid", + backup_accessor="content_object.gcmd_uuid", ) class Meta(LimitedTableBase.Meta): @@ -456,8 +456,8 @@ class Meta(LimitedTableBase.Meta): class MeasurementRegionChangeListTable(LimitedTableBase): - example = ConditionalValueColumn( - verbose_name="Example", accessor="update__example", update_accessor="content_object.example" + example = BackupValueColumn( + verbose_name="Example", accessor="update__example", backup_accessor="content_object.example" ) class Meta(LimitedTableBase.Meta): @@ -467,8 +467,8 @@ class Meta(LimitedTableBase.Meta): class GeographicalRegionChangeListTable(LimitedTableBase): - example = ConditionalValueColumn( - verbose_name="Example", accessor="update__example", update_accessor="content_object.example" + example = BackupValueColumn( + verbose_name="Example", accessor="update__example", backup_accessor="content_object.example" ) class Meta(LimitedTableBase.Meta): @@ -478,8 +478,8 @@ class Meta(LimitedTableBase.Meta): class GeophysicalConceptChangeListTable(LimitedTableBase): - example = ConditionalValueColumn( - verbose_name="Example", accessor="update__example", update_accessor="content_object.example" + example = BackupValueColumn( + verbose_name="Example", accessor="update__example", backup_accessor="content_object.example" ) class Meta(LimitedTableBase.Meta): @@ -489,8 +489,8 @@ class Meta(LimitedTableBase.Meta): class PartnerOrgChangeListTable(LimitedTableBase): - website = ConditionalValueColumn( - verbose_name="Website", accessor="update__website", update_accessor="content_object.website" + website = BackupValueColumn( + verbose_name="Website", accessor="update__website", backup_accessor="content_object.website" ) class Meta(LimitedTableBase.Meta): @@ -522,16 +522,16 @@ class Meta(LimitedTableBase.Meta): class CampaignChangeListTable(LimitedTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( verbose_name="Short Name", accessor="latest_update__short_name", - update_accessor="content_object.short_name", + backup_accessor="content_object.short_name", linkify=("change-update", [tables.A("uuid")]), ) - funding_agency = ConditionalValueColumn( + funding_agency = BackupValueColumn( verbose_name="Funding Agency", accessor="latest_update__funding_agency", - update_accessor="content_object.funding_agency", + backup_accessor="content_object.funding_agency", ) class Meta(LimitedTableBase.Meta): @@ -558,10 +558,10 @@ def render_short_name(self, value, record): class PlatformChangeListTable(LimitedTableBase): - platform_type = ConditionalValueColumn( + platform_type = BackupValueColumn( verbose_name="Platform Type", accessor="platform_type_name", - update_accessor="content_object.platform_type", + backup_accessor="content_object.platform_type", ) class Meta(LimitedTableBase.Meta): @@ -611,10 +611,10 @@ def render_short_name(self, value, record): # TODO: does this actually need to link to the campaign detail page? class ChangeSummaryTable(DraftTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( verbose_name="Short Name", accessor="update__short_name", - update_accessor="content_object.short_name", + backup_accessor="content_object.short_name", linkify=("change-update", [tables.A("uuid")]), ) content_type__model = tables.Column( @@ -648,20 +648,20 @@ class Meta: class WebsiteChangeListTable(DraftTableBase): - title = ConditionalValueColumn( + title = BackupValueColumn( verbose_name="Title", accessor="update__title", - update_accessor="content_object.title", + backup_accessor="content_object.title", linkify=("change-update", [tables.A("uuid")]), ) - url = ConditionalValueColumn( - verbose_name="URL", accessor="update__url", update_accessor="content_object.url" + url = BackupValueColumn( + verbose_name="URL", accessor="update__url", backup_accessor="content_object.url" ) website_type = ShortNamefromUUIDColumn( verbose_name="Website Type", model=WebsiteType, accessor="update__website_type", - update_accessor="content_object.website_type", + backup_accessor="content_object.website_type", ) class Meta(DraftTableBase.Meta): @@ -671,17 +671,17 @@ class Meta(DraftTableBase.Meta): class AliasChangeListTable(DraftTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( verbose_name="Short Name", accessor="update__short_name", - update_accessor="content_object.short_name", + backup_accessor="content_object.short_name", linkify=("change-update", [tables.A("uuid")]), ) # TODO replace model_type which short_name of related object - model_type = ConditionalValueColumn( + model_type = BackupValueColumn( verbose_name="Item Type", accessor="update__model_name", - update_accessor="content_object.model_name", + backup_accessor="content_object.model_name", ) class Meta(DraftTableBase.Meta): @@ -691,19 +691,19 @@ class Meta(DraftTableBase.Meta): class GcmdProjectChangeListTable(DraftTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( verbose_name="Short Name", accessor="update__short_name", - update_accessor="content_object.short_name", + backup_accessor="content_object.short_name", linkify=("change-update", [tables.A("uuid")]), ) - long_name = ConditionalValueColumn( + long_name = BackupValueColumn( verbose_name="Long Name", accessor="update__long_name", - update_accessor="content_object.long_name", + backup_accessor="content_object.long_name", ) - bucket = ConditionalValueColumn( - verbose_name="Bucket", accessor="update__bucket", update_accessor="content_object.bucket" + bucket = BackupValueColumn( + verbose_name="Bucket", accessor="update__bucket", backup_accessor="content_object.bucket" ) class Meta(DraftTableBase.Meta): @@ -713,36 +713,36 @@ class Meta(DraftTableBase.Meta): class GcmdInstrumentChangeListTable(DraftTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( verbose_name="Short Name", accessor="update__short_name", - update_accessor="content_object.short_name", + backup_accessor="content_object.short_name", linkify=("change-update", [tables.A("uuid")]), ) - long_name = ConditionalValueColumn( + long_name = BackupValueColumn( verbose_name="Long Name", accessor="update__long_name", - update_accessor="content_object.long_name", + backup_accessor="content_object.long_name", ) - instrument_category = ConditionalValueColumn( + instrument_category = BackupValueColumn( verbose_name="Instrument Category", accessor="update__instrument_category", - update_accessor="content_object.instrument_category", + backup_accessor="content_object.instrument_category", ) - instrument_class = ConditionalValueColumn( + instrument_class = BackupValueColumn( verbose_name="Instrument Class", accessor="update__instrument_class", - update_accessor="content_object.instrument_class", + backup_accessor="content_object.instrument_class", ) - instrument_type = ConditionalValueColumn( + instrument_type = BackupValueColumn( verbose_name="Instrument Type", accessor="update__instrument_type", - update_accessor="content_object.instrument_type", + backup_accessor="content_object.instrument_type", ) - instrument_subtype = ConditionalValueColumn( + instrument_subtype = BackupValueColumn( verbose_name="Instrument Subtype", accessor="update__instrument_subtype", - update_accessor="content_object.instrument_subtype", + backup_accessor="content_object.instrument_subtype", ) class Meta(DraftTableBase.Meta): @@ -759,21 +759,21 @@ class Meta(DraftTableBase.Meta): class GcmdPlatformChangeListTable(DraftTableBase): - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( verbose_name="Short Name", accessor="update__short_name", - update_accessor="content_object.short_name", + backup_accessor="content_object.short_name", linkify=("change-update", [tables.A("uuid")]), ) - long_name = ConditionalValueColumn( + long_name = BackupValueColumn( verbose_name="Long Name", accessor="update__long_name", - update_accessor="content_object.long_name", + backup_accessor="content_object.long_name", ) - category = ConditionalValueColumn( + category = BackupValueColumn( verbose_name="Category", accessor="update__category", - update_accessor="content_object.category", + backup_accessor="content_object.category", ) class Meta(DraftTableBase.Meta): @@ -783,32 +783,32 @@ class Meta(DraftTableBase.Meta): class GcmdPhenomenonChangeListTable(DraftTableBase): - variable_3 = ConditionalValueColumn( + variable_3 = BackupValueColumn( verbose_name="Variable 3", accessor="update__variable_3", - update_accessor="content_object.variable_3", + backup_accessor="content_object.variable_3", linkify=("change-update", [tables.A("uuid")]), ) - variable_2 = ConditionalValueColumn( + variable_2 = BackupValueColumn( verbose_name="Variable 2", accessor="update__variable_2", - update_accessor="content_object.variable_2", + backup_accessor="content_object.variable_2", ) - variable_1 = ConditionalValueColumn( + variable_1 = BackupValueColumn( verbose_name="Variable 1", accessor="update__variable_1", - update_accessor="content_object.variable_1", + backup_accessor="content_object.variable_1", ) - term = ConditionalValueColumn( - verbose_name="Term", accessor="update__term", update_accessor="content_object.term" + term = BackupValueColumn( + verbose_name="Term", accessor="update__term", backup_accessor="content_object.term" ) - topic = ConditionalValueColumn( - verbose_name="Topic", accessor="update__topic", update_accessor="content_object.topic" + topic = BackupValueColumn( + verbose_name="Topic", accessor="update__topic", backup_accessor="content_object.topic" ) - category = ConditionalValueColumn( + category = BackupValueColumn( verbose_name="Category", accessor="update__category", - update_accessor="content_object.category", + backup_accessor="content_object.category", ) class Meta(DraftTableBase.Meta): @@ -840,26 +840,26 @@ class GcmdSyncListTable(DraftTableBase): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - short_name = ConditionalValueColumn( + short_name = BackupValueColumn( verbose_name="GCMD Keyword", accessor="short_name", - update_accessor="content_object.short_name", + backup_accessor="content_object.short_name", linkify=("change-gcmd", [tables.A("uuid")]), ) - category = ConditionalValueColumn( + category = BackupValueColumn( verbose_name="Category", accessor="content_type__model", - update_accessor="content_type__model", + backup_accessor="content_type__model", ) - draft_action = ConditionalValueColumn( + draft_action = BackupValueColumn( verbose_name="Type of Change", accessor="action", - update_accessor="action", + backup_accessor="action", ) - status = ConditionalValueColumn( + status = BackupValueColumn( verbose_name="Status", accessor="status", - update_accessor="status", + backup_accessor="status", ) affected_records = AffectedRecordValueColumn( verbose_name="Affected Records", @@ -890,10 +890,10 @@ class Meta(DraftTableBase.Meta): class ImageChangeListTable(DraftTableBase): - title = ConditionalValueColumn( + title = BackupValueColumn( verbose_name="Title", accessor="update__title", - update_accessor="content_object.title", + backup_accessor="content_object.title", linkify=("change-update", [tables.A("uuid")]), )