Input¶
Module contents¶
Definition of all the models required to create an input specification for
some AnalysisVersion
and
keep track of the inputs associated with some
Run
instance.
Subpackages¶
Submodules¶
django_analyses.models.input.input module¶
Definition of the base Input
model.
-
class
django_analyses.models.input.input.
Input
(*args, **kwargs)¶ Bases:
django.db.models.base.Model
This model serves as a base class for different types of inputs.
-
argument_value
¶ Returns the value of the input as expected by the interface.
Returns: Input value as expected by the interface Return type: Any
-
definition
= None¶
-
get_argument_value
() → Any¶ Returns the input’s value after applying any manipulations specified by the associated
definition
. This method is used to bridge database-compatible values with non-database-compatible values required by interfaces.Returns: Input value as expected by the interface Return type: Any
-
key
¶ Returns the key of the associated
definition
.Returns: Input definition key Return type: str
-
objects
= <model_utils.managers.InheritanceManager object>¶
-
pre_save
() → None¶ If this input class’s
value
is aForeignKey
field, fix it in cases it is provided asint
(the instance’s primary key).Note
This method may be overridden by subclasses to implement custom functionality before saving. However, be sure to include:
super().pre_save()
within your custom function.
If this input’s definition points to a related model’s field, returns the related instance (i.e. the instance in which the field’s value is this input’s value).
Returns: related instance Return type: Any
-
raise_required_error
()¶ Raises ValidationError to indicate this input is required.
Raises: ValidationError
– Required input not provided
-
validate
() → None¶ Run any custom validations before saving the model.
Note
This method may be overridden by subclasses to implement custom functionality before saving. However, be sure to include:
super().pre_save()
within your custom function.
-
value
= None¶ The value field is meant to be overriden by subclasses according to the type of data provided as input.
-
value_is_foreign_key
¶ Checks whether the
value
attribute is aForeignKey
field.Returns: value
is foreign key or notReturn type: bool
-
django_analyses.models.input.input_specification module¶
Definition of the InputSpecification
class.
-
class
django_analyses.models.input.input_specification.
InputSpecification
(id, created, modified, analysis)¶ Bases:
django_extensions.db.models.TimeStampedModel
-
analysis
¶ 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 aForwardManyToOneDescriptor
instance.
-
analysis_version_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
base_input_definitions
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
configuration_keys
¶
-
default_configuration
¶
-
get_configuration_keys
() → set¶
-
get_default_input_configurations
() → dict¶
-
input_definitions
¶
-
objects
= <django_analyses.models.managers.input_specification.InputSpecificationManager object>¶
-
validate_keys
(**kwargs) → None¶
-
validate_kwargs
(**kwargs) → None¶
-
validate_required
(**kwargs) → None¶
-