This commit is contained in:
CocoByte 2024-11-26 14:40:43 -07:00
parent bf34df52dd
commit e7c22ce51f
No known key found for this signature in database
GPG key ID: BBFAA2526384C97F
6 changed files with 13 additions and 27 deletions

View file

@ -198,8 +198,8 @@ class BaseExport(ABC):
# We can infer that if we're passing in annotations,
# we want to grab the result of said annotation.
if computed_fields :
related_table_fields.extend(computed_fields .keys())
if computed_fields:
related_table_fields.extend(computed_fields.keys())
# Get prexisting fields on the model
model_fields = set()
@ -213,26 +213,6 @@ class BaseExport(ABC):
return cls.update_queryset(queryset, **kwargs)
@classmethod
def export_data_to_csv(cls, csv_file, **kwargs):
"""
All domain metadata:
Exports domains of all statuses plus domain managers.
"""
writer = csv.writer(csv_file)
columns = cls.get_columns()
models_dict = cls.get_model_annotation_dict(**kwargs)
# Write to csv file before the write_csv
cls.write_csv_before(writer, **kwargs)
# Write the csv file
rows = cls.write_csv(writer, columns, models_dict)
# Return rows that for easier parsing and testing
return rows
@classmethod
def get_annotated_queryset(cls, **kwargs):
"""Returns an annotated queryset based off of all query conditions."""