mission_control.models

Mission Control models.

Classes

Application(id, client_id, user, ...)
BlockDiagram(\*args, \*\*kwargs) Attributes to describe a single block diagram.
Rover(\*args, \*\*kwargs) Attributes to describe a single rover.
User(id, password, last_login, is_superuser, ...)
class mission_control.models.BlockDiagram(*args, **kwargs)

Bases: django.db.models.base.Model

Attributes to describe a single block diagram.

_check_field_name_clashes()

Ref #17673.

_check_fields(**kwargs)

Perform all field checks.

_check_id_field()

Check if id field is a primary key.

_check_index_together()

Check the value of “index_together” option.

_check_long_column_names()

Check that any auto-generated column names are shorter than the limits for each database in which the model will be created.

_check_m2m_through_same_relationship()

Check if no relationship model is used by more than one m2m field.

_check_managers(**kwargs)

Perform all manager checks.

_check_ordering()

Check “ordering” option – is it a list of strings and do all fields exist?

_check_swappable()

Check if the swapped model exists.

_check_unique_together()

Check the value of “unique_together” option.

_do_insert(manager, using, fields, update_pk, raw)

Do an INSERT. If update_pk is defined then this method should return the new pk for the model.

_do_update(base_qs, using, pk_val, values, update_fields, forced_update)

This method will try to update the model. If the model was updated (in the sense that an update query was done and a matching row was found from the DB) the method will return True.

_get_unique_checks(exclude=None)

Gather a list of checks to perform. Since validate_unique could be called from a ModelForm, some fields may have been excluded; we can’t perform a unique check on a model that is missing fields involved in that check. Fields that did not validate should also be excluded, but they need to be passed in via the exclude argument.

_save_parents(cls, using, update_fields)

Saves all the parents of cls using values from self.

_save_table(raw=False, cls=None, force_insert=False, force_update=False, using=None, update_fields=None)

Does the heavy-lifting involved in saving. Updates or inserts the data for a single table.

clean()

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

clean_fields(exclude=None)

Cleans all fields and raises a ValidationError containing a dict of all validation errors if any occur.

full_clean(exclude=None, validate_unique=True)

Calls clean_fields, clean, and validate_unique, on the model, and raises a ValidationError for any errors that occurred.

get_deferred_fields()

Returns a set containing names of deferred fields for this instance.

refresh_from_db(using=None, fields=None)

Reloads field values from the database.

By default, the reloading happens from the database this instance was loaded from, or by the read router if this instance wasn’t loaded from any database. The using parameter will override the default.

Fields can be used to specify which fields to reload. The fields should be an iterable of field attnames. If fields is None, then all non-deferred fields are reloaded.

When accessing deferred fields of an instance, the deferred loading of the field will call this method.

save(force_insert=False, force_update=False, using=None, update_fields=None)

Saves the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

save_base(raw=False, force_insert=False, force_update=False, using=None, update_fields=None)

Handles the parts of saving which should be done only once per save, yet need to be done in raw saves, too. This includes some sanity checks and signal sending.

The ‘raw’ argument is telling save_base not to save any parent models and not to do any changes to the values before save. This is used by fixture loading.

serializable_value(field_name)

Returns the value of the field name for this instance. If the field is a foreign key, returns the id value, instead of the object. If there’s no Field object with this name on the model, the model attribute’s value is returned directly.

Used to serialize a field’s value (in the serializer, or form output, for example). Normally, you would just access the attribute directly and not use this method.

validate_unique(exclude=None)

Checks unique constraints on the model and raises ValidationError if any failed.

class mission_control.models.Rover(*args, **kwargs)

Bases: django.db.models.base.Model

Attributes to describe a single rover.

_check_field_name_clashes()

Ref #17673.

_check_fields(**kwargs)

Perform all field checks.

_check_id_field()

Check if id field is a primary key.

_check_index_together()

Check the value of “index_together” option.

_check_long_column_names()

Check that any auto-generated column names are shorter than the limits for each database in which the model will be created.

_check_m2m_through_same_relationship()

Check if no relationship model is used by more than one m2m field.

_check_managers(**kwargs)

Perform all manager checks.

_check_ordering()

Check “ordering” option – is it a list of strings and do all fields exist?

_check_swappable()

Check if the swapped model exists.

_check_unique_together()

Check the value of “unique_together” option.

_do_insert(manager, using, fields, update_pk, raw)

Do an INSERT. If update_pk is defined then this method should return the new pk for the model.

_do_update(base_qs, using, pk_val, values, update_fields, forced_update)

This method will try to update the model. If the model was updated (in the sense that an update query was done and a matching row was found from the DB) the method will return True.

_get_unique_checks(exclude=None)

Gather a list of checks to perform. Since validate_unique could be called from a ModelForm, some fields may have been excluded; we can’t perform a unique check on a model that is missing fields involved in that check. Fields that did not validate should also be excluded, but they need to be passed in via the exclude argument.

_save_parents(cls, using, update_fields)

Saves all the parents of cls using values from self.

_save_table(raw=False, cls=None, force_insert=False, force_update=False, using=None, update_fields=None)

Does the heavy-lifting involved in saving. Updates or inserts the data for a single table.

clean()

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

clean_fields(exclude=None)

Cleans all fields and raises a ValidationError containing a dict of all validation errors if any occur.

full_clean(exclude=None, validate_unique=True)

Calls clean_fields, clean, and validate_unique, on the model, and raises a ValidationError for any errors that occurred.

get_deferred_fields()

Returns a set containing names of deferred fields for this instance.

refresh_from_db(using=None, fields=None)

Reloads field values from the database.

By default, the reloading happens from the database this instance was loaded from, or by the read router if this instance wasn’t loaded from any database. The using parameter will override the default.

Fields can be used to specify which fields to reload. The fields should be an iterable of field attnames. If fields is None, then all non-deferred fields are reloaded.

When accessing deferred fields of an instance, the deferred loading of the field will call this method.

save(force_insert=False, force_update=False, using=None, update_fields=None)

Saves the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

save_base(raw=False, force_insert=False, force_update=False, using=None, update_fields=None)

Handles the parts of saving which should be done only once per save, yet need to be done in raw saves, too. This includes some sanity checks and signal sending.

The ‘raw’ argument is telling save_base not to save any parent models and not to do any changes to the values before save. This is used by fixture loading.

serializable_value(field_name)

Returns the value of the field name for this instance. If the field is a foreign key, returns the id value, instead of the object. If there’s no Field object with this name on the model, the model attribute’s value is returned directly.

Used to serialize a field’s value (in the serializer, or form output, for example). Normally, you would just access the attribute directly and not use this method.

validate_unique(exclude=None)

Checks unique constraints on the model and raises ValidationError if any failed.