ferrosoft.apps.dataimport package

Subpackages

Submodules

ferrosoft.apps.dataimport.admin module

ferrosoft.apps.dataimport.apps module

class ferrosoft.apps.dataimport.apps.DataimportConfig(app_name, app_module)[source]

Bases: AppConfig

default_auto_field = 'django.db.models.BigAutoField'
name = 'ferrosoft.apps.dataimport'
verbose_name = 'Data import'

ferrosoft.apps.dataimport.convert module

ferrosoft.apps.dataimport.convert.convert_line(line_no, line, job, field_mappings, collection)[source]

Convert line to model instance and save the latter.

Parameters:
  • line_no (int) – Current line number

  • line (dict) – Current line

  • job (ImportJob) – ImportJob where the current line belongs to.

  • field_mappings (List[FieldMapping]) – Field mappings associated with the collection.

  • collection (MappingCollection) – Mapping collection associated with the job.

Return type:

Tuple[object | None, List[LogEntry]]

Returns: Created model (or None) and list of LogEntry objects created by this function.

ferrosoft.apps.dataimport.convert.create_or_get_model(model_type, creator)[source]

Create model or get it if it exists already.

If creator function raises IntegrityError, get model by the unique fields reported in the exception.

Parameters:
  • model_type (Type[TypeVar(T)]) – Model class type.

  • creator (Callable[[], TypeVar(T)]) – Function creating the model and returning it.

Return type:

TypeVar(T)

Returns: Model instance.

ferrosoft.apps.dataimport.convert.extract_unique_fields(exception)[source]
Return type:

dict | None

ferrosoft.apps.dataimport.convert.import_job_lines(job, processor_state)[source]

Process file lines from job as CSV, run process_import_line on each line.

Parameters:
  • job (ImportJob) – Job to process.

  • processor_state – Result from processor before job. Can be anything, is passed along to model processor.

ferrosoft.apps.dataimport.filter module

class ferrosoft.apps.dataimport.filter.LogEntryFilter(data=None, queryset=None, *, request=None, prefix=None)[source]

Bases: FilterSet

class Meta[source]

Bases: object

fields = ['log_time', 'line_no', 'highlight']
model

alias of LogEntry

base_filters = {'highlight': <django_filters.filters.MultipleChoiceFilter object>, 'line_no': <django_filters.filters.NumberFilter object>, 'log_time': <django_filters.filters.DateTimeFromToRangeFilter object>}
declared_filters = {'highlight': <django_filters.filters.MultipleChoiceFilter object>, 'log_time': <django_filters.filters.DateTimeFromToRangeFilter object>}

ferrosoft.apps.dataimport.forms module

class ferrosoft.apps.dataimport.forms.ImportJobForm(*args, **kwargs)[source]

Bases: Form

base_fields = {'collection': <django.forms.models.ModelChoiceField object>, 'date_format_codes': <django.forms.fields.CharField object>, 'date_format_type': <django.forms.fields.ChoiceField object>, 'date_time_format_codes': <django.forms.fields.CharField object>, 'decimal_separator': <django.forms.fields.CharField object>, 'field_separator': <django.forms.fields.CharField object>, 'import_file': <django.forms.fields.FileField object>, 'model_processor': <django.forms.fields.CharField object>, 'processor_after_job': <django.forms.fields.CharField object>, 'processor_before_job': <django.forms.fields.CharField object>, 'text_encoding': <django.forms.fields.ChoiceField object>}
clean()[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

declared_fields = {'collection': <django.forms.models.ModelChoiceField object>, 'date_format_codes': <django.forms.fields.CharField object>, 'date_format_type': <django.forms.fields.ChoiceField object>, 'date_time_format_codes': <django.forms.fields.CharField object>, 'decimal_separator': <django.forms.fields.CharField object>, 'field_separator': <django.forms.fields.CharField object>, 'import_file': <django.forms.fields.FileField object>, 'model_processor': <django.forms.fields.CharField object>, 'processor_after_job': <django.forms.fields.CharField object>, 'processor_before_job': <django.forms.fields.CharField object>, 'text_encoding': <django.forms.fields.ChoiceField object>}
property media

Return all media required to render the widgets on this form.

save()[source]
class ferrosoft.apps.dataimport.forms.SettingsForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: ModelForm

class Meta[source]

Bases: object

fields = ['import_file_dir']
model

alias of Settings

base_fields = {'import_file_dir': <django.forms.models.ModelChoiceField object>}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

ferrosoft.apps.dataimport.models module

class ferrosoft.apps.dataimport.models.DateFormatType(*values)[source]

Bases: TextChoices

CUSTOM = 'CUSTOM'
ISO_8601 = 'ISO-8601'
class ferrosoft.apps.dataimport.models.EnumConverter(enum_class)[source]

Bases: object

convert(value)[source]
class ferrosoft.apps.dataimport.models.FieldMapping(id, collection, field_type, input_field_name, output_field_name, related_model, related_field, required, enum_class, scope)[source]

Bases: UUIDModel

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

collection

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

collection_id
describe_foreign_key()[source]
enum_choices()[source]
enum_class

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

field_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_enum_converter()[source]
Return type:

EnumConverter | None

get_field_type_display(*, field=<django.db.models.fields.CharField: field_type>)
get_model_field()[source]
Return type:

Type[UUIDModel]

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

input_field_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <ferrosoft.apps.dataimport.models.FieldMappingManager object>
output_field_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

related_field

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

related_model

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

required

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

scope

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class ferrosoft.apps.dataimport.models.FieldMappingManager(*args, **kwargs)[source]

Bases: Manager

get_ordered()[source]
class ferrosoft.apps.dataimport.models.FieldType(*values)[source]

Bases: TextChoices

BOOLEAN = 'BL'
DATE = 'DA'
DATE_TIME = 'DT'
DECIMAL = 'DC'
FOREIGN_KEY = 'FK'
INTEGER = 'IT'
PRIMARY_KEY = 'PK'
TEXT = 'TX'
classmethod guess(field)[source]
class ferrosoft.apps.dataimport.models.FormatParameters(field_separator, decimal_separator, date_format, date_format_codes, date_time_format_codes)[source]

Bases: object

Specify format parameters of input field values.

Parameters:
  • field_separator (str) – CSV field separator, e.g. comma.

  • decimal_separator (str) – Decimal separator, e.g. dot.

  • date_format (DateFormatType) – Specify pre-defined date formats.

  • date_format_codes (str) – Custom date format (any format codes supported by datetime.strptime).

  • date_time_format_codes (str) – Custom date time format (any format codes supported by datetime.strptime).

date_format: DateFormatType
date_format_codes: str
date_time_format_codes: str
decimal_separator: str
field_separator: str
class ferrosoft.apps.dataimport.models.ImportJob(id, name, text_encoding, field_separator, decimal_separator, date_format, date_format_codes, date_time_format_codes, collection, processor_before_job, processor_after_job, model_processor, creation_time, status, import_file, line_count)[source]

Bases: ImportJobMixin, UUIDModel

exception DoesNotExist

Bases: ObjectDoesNotExist

EXPIRE_FILE_ON = datetime.timedelta(days=1)
exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

collection

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

collection_id
classmethod create(import_file, import_file_name, text_encoding, owner, collection, format_params, processors)[source]
creation_time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_format

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_format_codes

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_time_format_codes

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

decimal_separator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod default_file_expiry(creation_time)[source]
Return type:

<module ‘datetime’ from ‘/home/ap/.local/share/uv/python/cpython-3.14.5-linux-x86_64-gnu/lib/python3.14/datetime.py’>

field_separator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property format_parameters: FormatParameters
get_absolute_url()[source]
get_date_format_display(*, field=<django.db.models.fields.CharField: date_format>)
get_next_by_creation_time(*, field=<django.db.models.fields.DateTimeField: creation_time>, is_next=True, **kwargs)
get_previous_by_creation_time(*, field=<django.db.models.fields.DateTimeField: creation_time>, is_next=False, **kwargs)
get_status_display(*, field=<django.db.models.fields.CharField: status>)
get_text_encoding_display(*, field=<django.db.models.fields.CharField: text_encoding>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

import_file

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

import_file_id
is_done()[source]

Return True if job is surely done, either finished or errored.

Return type:

bool

is_status(status)[source]
Return type:

bool

line_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

logentry_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

logs()[source]
model_processor

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
processor_after_job

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

processor_before_job

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

queue_group_name()[source]
set_status(status)[source]
status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

text_encoding

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class ferrosoft.apps.dataimport.models.ImportJobMixin(*args, **kwargs)[source]

Bases: UUIDModel

DEFAULT_DATE_FORMAT_CODES = '%Y-%m-%d'
DEFAULT_DATE_TIME_FORMAT_CODES = '%Y-%m-%d %H:%M:%S'
DEFAULT_DECIMAL_SEPARATOR = '.'
DEFAULT_FIELD_SEPARATOR = ','
class Meta[source]

Bases: object

abstract = False
collection

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

collection_id
date_format

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_format_codes

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_time_format_codes

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

decimal_separator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

field_separator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_date_format_display(*, field=<django.db.models.fields.CharField: date_format>)
get_text_encoding_display(*, field=<django.db.models.fields.CharField: text_encoding>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

model_processor

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

processor_after_job

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

processor_before_job

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

text_encoding

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class ferrosoft.apps.dataimport.models.ImportJobTemplate(id, name, text_encoding, field_separator, decimal_separator, date_format, date_format_codes, date_time_format_codes, collection, processor_before_job, processor_after_job, model_processor, code_name)[source]

Bases: ImportJobMixin, UUIDModel

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

code_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

collection

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

collection_id
date_format

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_format_codes

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_time_format_codes

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

decimal_separator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

field_separator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_date_format_display(*, field=<django.db.models.fields.CharField: date_format>)
get_text_encoding_display(*, field=<django.db.models.fields.CharField: text_encoding>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

model_processor

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
processor_after_job

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

processor_before_job

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

text_encoding

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class ferrosoft.apps.dataimport.models.ImportStatus(*values)[source]

Bases: TextChoices

ERRORED = 'E'
FINISHED = 'F'
NEW = 'N'
PROCESSING = 'P'
class ferrosoft.apps.dataimport.models.LogEntry(id, import_job, log_time, line_no, highlight, message, context)[source]

Bases: UUIDModel

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

context

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

classmethod create(job, line_no, message, highlight=None, context=None)[source]
get_highlight_display(*, field=<django.db.models.fields.CharField: highlight>)
get_next_by_log_time(*, field=<django.db.models.fields.DateTimeField: log_time>, is_next=True, **kwargs)
get_previous_by_log_time(*, field=<django.db.models.fields.DateTimeField: log_time>, is_next=False, **kwargs)
highlight

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

import_job

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

import_job_id
line_no

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

log_time

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

message

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
class ferrosoft.apps.dataimport.models.LogHighlight(*values)[source]

Bases: TextChoices

DANGER = 'danger'
INFO = 'info'
NONE = ''
PRIMARY = 'primary'
SECONDARY = 'secondary'
SUCCESS = 'success'
WARNING = 'warning'
class ferrosoft.apps.dataimport.models.MappingCollection(id, name, model_name, documentation)[source]

Bases: UUIDModel

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

classmethod create_mapping_for_model(name, model)[source]
Return type:

MappingCollection

documentation

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

field_mappings

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_absolute_url()[source]
Return type:

str

get_model()[source]
Return type:

Type[UUIDModel]

get_model_without_app()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

importjob_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

importjobtemplate_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

model_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
class ferrosoft.apps.dataimport.models.Processors(before_job, after_job, model)[source]

Bases: object

after_job: str | None
before_job: str | None
model: str | None
class ferrosoft.apps.dataimport.models.Settings(id, import_file_dir)[source]

Bases: UUIDModel

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

static get_absolute_url()[source]
classmethod get_import_file_dir()[source]
Return type:

Directory

classmethod get_instance()[source]
Return type:

Settings

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

import_file_dir

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

import_file_dir_id
objects = <django.db.models.manager.Manager object>
exception ferrosoft.apps.dataimport.models.UndefinedSettings[source]

Bases: Exception

exception ferrosoft.apps.dataimport.models.UnknownEnumName[source]

Bases: RuntimeError

ferrosoft.apps.dataimport.models.enumerate_models()[source]

ferrosoft.apps.dataimport.queue module

exception ferrosoft.apps.dataimport.queue.ForbiddenProcessor[source]

Bases: ProcessorError

class ferrosoft.apps.dataimport.queue.ModelProcessorArgs(job, ui_updater, model, processor_state, line_number)[source]

Bases: object

job: ImportJob
line_number: int
model: object
processor_state: Any
ui_updater: ImportJobUIUpdater
class ferrosoft.apps.dataimport.queue.ProcessorArgs(job, ui_updater)[source]

Bases: object

job: ImportJob
ui_updater: ImportJobUIUpdater
exception ferrosoft.apps.dataimport.queue.ProcessorError[source]

Bases: Exception

exception ferrosoft.apps.dataimport.queue.ProcessorNotFound[source]

Bases: ProcessorError

async ferrosoft.apps.dataimport.queue.process_import_job(import_job_id)[source]
async ferrosoft.apps.dataimport.queue.process_import_line(job_data, line_no, line, processor_state) bool[source]
Return type:

bool

ferrosoft.apps.dataimport.tables module

class ferrosoft.apps.dataimport.tables.RecentJobsTable(data=None, order_by=None, orderable=None, empty_text=None, exclude=None, attrs=None, row_attrs=None, pinned_row_attrs=None, sequence=None, prefix=None, order_by_field=None, page_field=None, per_page_field=None, template_name=None, default=None, request=None, show_header=None, show_footer=True, extra_columns=None)[source]

Bases: Table

class Meta[source]

Bases: object

fields = ['creation_time', 'name', 'line_count', 'status', 'collection']
model

alias of ImportJob

template_name = 'ferrobase/table_bootstrap5.html'
base_columns = {'collection': <django_tables2.columns.base.Column object>, 'creation_time': <django_tables2.columns.datetimecolumn.DateTimeColumn object>, 'line_count': <django_tables2.columns.base.Column object>, 'name': <django_tables2.columns.base.Column object>, 'status': <django_tables2.columns.base.Column object>, 'view': <ferrosoft.apps.ferrobase.tables.columns.ActionColumn object>}

ferrosoft.apps.dataimport.tests module

ferrosoft.apps.dataimport.urls module

ferrosoft.apps.dataimport.views module

class ferrosoft.apps.dataimport.views.IndexView(**kwargs)[source]

Bases: LoginRequiredMixin, PlatformActivityMixin, ListView

activity_title = 'Recent Imports'

Activity title should be a very short label e.g. indicating the current model being operated on.

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

model

alias of ImportJob

paginate_by = 10
template_name = 'dataimport/index.html'
class ferrosoft.apps.dataimport.views.JobCreateView(*args, **kwargs)[source]

Bases: LoginRequiredMixin, PlatformActivityMixin, FormView

activity_title = 'New Import'

Activity title should be a very short label e.g. indicating the current model being operated on.

form_class

alias of ImportJobForm

form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

get(*args, **kwargs)[source]

Handle GET requests: instantiate a blank version of the form.

get_context_data(**kwargs)[source]

Inject activity metadata (title, app, container, help URL) into the context.

Raises:

RuntimeError – If neither activity_app nor a string template_name is defined and the app label cannot be inferred.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

template_name = 'dataimport/job/create.html'
class ferrosoft.apps.dataimport.views.JobDetail(*args, **kwargs)[source]

Bases: LoginRequiredMixin, PlatformActivityMixin, DetailView

activity_title = 'Import Report'

Activity title should be a very short label e.g. indicating the current model being operated on.

get(request, *args, **kwargs)[source]
get_context_data(**kwargs)[source]

Inject activity metadata (title, app, container, help URL) into the context.

Raises:

RuntimeError – If neither activity_app nor a string template_name is defined and the app label cannot be inferred.

model

alias of ImportJob

template_name = 'dataimport/job/detail.html'
class ferrosoft.apps.dataimport.views.JobFromTemplateBaseView(**kwargs)[source]

Bases: ListView

get_context_data(**kwargs)[source]

Get the context for this view.

model

alias of ImportJobTemplate

paginate_by = 10
template_name = 'dataimport/job/from-template.html'
class ferrosoft.apps.dataimport.views.JobFromTemplateView(**kwargs)[source]

Bases: LoginRequiredMixin, PlatformActivityMixin, JobFromTemplateBaseView

activity_title = 'New Import'

Activity title should be a very short label e.g. indicating the current model being operated on.

class ferrosoft.apps.dataimport.views.JobLogList(**kwargs)[source]

Bases: FilterView

activity_app = 'dataimport'

Django identifier of the app the activity belongs to. If it is None, the app is derived from template_name.

activity_title = 'Import Log'

Activity title should be a very short label e.g. indicating the current model being operated on.

create_view: str | Callable[[...], str] | None = 'dataimport:logentry_create'

List view displays a button to create a new object if create_view is not None.

filterset_class

alias of LogEntryFilter

get_queryset()[source]

Return the list of items for this view.

The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.

model

alias of LogEntry

ordering = '-log_time'
paginate_by = 100
permission_required = ['dataimport.view_logentry']
plural = 'log entrys'

Plural may be used by templates to display the model name.

singular = 'log entry'

Singular may be used by templates to display the model name.

template_name = 'dataimport/job/log-list.html'
class ferrosoft.apps.dataimport.views.SettingsIndex(**kwargs)[source]

Bases: LoginRequiredMixin, PlatformActivityMixin, UpdateView

activity_title = 'Settings'

Activity title should be a very short label e.g. indicating the current model being operated on.

form_class

alias of SettingsForm

get_object(**kwargs)[source]

Return the object the view is displaying.

Require self.queryset and a pk or slug argument in the URLconf. Subclasses can override this to return any object.

model

alias of Settings

template_name = 'dataimport/settings/index.html'
ferrosoft.apps.dataimport.views.collection_docs(request, id)[source]
ferrosoft.apps.dataimport.views.job_status(request, pk)[source]

ferrosoft.apps.dataimport.widgets module

class ferrosoft.apps.dataimport.widgets.ModelNameInput(attrs=None)[source]

Bases: TextInput

INPUT_CLASS = 'modelNameInput'
input_type = 'text'
property media
template_name = 'dataimport/widgets/model-name.html'