bottler.labels.models¶
Graph of models in the bottler.labels app and related apps.
-
class
bottler.labels.models.Label(*args, **kwargs)[source]¶ Bases:
django.db.models.base.ModelA Label defines a collection of LabelFields used to analyze and add metadata to a dictionary of bottled data.
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
-
add(data)[source]¶ Takes a dictionary of bottled data and returns the dictionary updated with metadata containing the results of analyses for the Label’s fields.
-
container_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.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
create(data)[source]¶ Takes a dictionary of bottled data and returns a dictionary of metadata containing the results of analyses for the Label’s LabelFields.
-
fields¶ 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.toppingsandtopping.pizzasareManyToManyDescriptorinstances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
get_fields()[source]¶ Returns a list of data dictionaries containing the field_name, field_type, and target_type of each of the Label’s fields.
-
id¶ 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= <bottler.labels.models.LabelManager object>¶
-
exception
-
class
bottler.labels.models.LabelField(*args, **kwargs)[source]¶ Bases:
bottler.datafields.models.DataFieldDefines a field in a Label.
Assigns a Procedure or Inspection to a Bottle to allow data enhancements for bottled data.
-
CONTENT_TYPES= <Q: (OR: (AND: ('model', 'procedure'), ('app_label', 'procedures')), (AND: ('model', 'inspection'), ('app_label', 'inspections')))>¶
-
exception
DoesNotExist¶
-
INSPECTION= <Q: (AND: ('model', 'inspection'), ('app_label', 'inspections'))>¶
-
exception
MultipleObjectsReturned¶
-
PROCEDURE= <Q: (AND: ('model', 'procedure'), ('app_label', 'procedures'))>¶
-
analyzer¶ Provide a generic many-to-one relation through the
content_typeandobject_idfields.This class also doubles as an accessor to the related object (similar to ForwardManyToOneDescriptor) by adding itself as a model attribute.
-
analyzer_type¶ Returns the name of the class for the type of analyzer, which can be either an Inspection or a Procedure.
-
content_type¶ 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.parentis aForwardManyToOneDescriptorinstance.
-
content_type_id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
create(data)[source]¶ Takes a dictionary of bottled data and returns a dictionary object containing the result of the analysis.
-
get_field_type_display(**morekwargs)¶
-
get_target_type_display(**morekwargs)¶
-
id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
label_set¶ 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.toppingsandtopping.pizzasareManyToManyDescriptorinstances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
object_id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects= <bottler.datafields.models.DataFieldManager object>¶
-
-
class
bottler.labels.models.LabelManager[source]¶ Bases:
cyphon.models.GetByNameManagerAdds methods to the default model manager.