Animals App

The animals application models the uid.models.Animal objects views and updates.

animals.forms

animals.forms module contents

Created on Thu Feb 7 15:38:46 2019

@author: Paolo Cozzi <cozzi@ibba.cnr.it>

class animals.forms.UpdateAnimalForm(animal, *args, **kwargs)[source]

Bases: common.forms.RequestFormMixin, django.forms.models.ModelForm

class Meta[source]

Bases: object

fields = ('disabled_name', 'alternative_id', 'description', 'breed', 'sex', 'disabled_mother', 'disabled_father', 'birth_date', 'birth_location', 'birth_location_latitude', 'birth_location_longitude', 'birth_location_accuracy')
model

alias of uid.models.Animal

__init__(animal, *args, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

base_fields = {'alternative_id': <django.forms.fields.CharField object>, 'birth_date': <django.forms.fields.DateField object>, 'birth_location': <django.forms.fields.CharField object>, 'birth_location_accuracy': <django.forms.fields.TypedChoiceField object>, 'birth_location_latitude': <django.forms.fields.FloatField object>, 'birth_location_longitude': <django.forms.fields.FloatField object>, 'breed': <django.forms.models.ModelChoiceField object>, 'description': <django.forms.fields.CharField object>, 'disabled_father': <django.forms.fields.CharField object>, 'disabled_mother': <django.forms.fields.CharField object>, 'disabled_name': <django.forms.fields.CharField object>, 'sex': <django.forms.models.ModelChoiceField 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 = {'disabled_father': <django.forms.fields.CharField object>, 'disabled_mother': <django.forms.fields.CharField object>, 'disabled_name': <django.forms.fields.CharField object>}
property media

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

animals.tasks

animals.tasks module contents

Created on Wed Feb 27 16:38:37 2019

@author: Paolo Cozzi <cozzi@ibba.cnr.it>

class animals.tasks.BatchDeleteAnimals(*args, **kwargs)[source]

Bases: submissions.tasks.SubmissionTaskMixin, common.tasks.NotifyAdminTaskMixin, common.tasks.BaseTask

action = 'batch delete animals'
description = 'Batch remove animals and associated samples'
ignore_result = False
name = 'Batch delete animals'
priority = None
rate_limit = None
reject_on_worker_lost = None
request_stack = <celery.utils.threads._LocalStack object>
run(submission_id, animal_ids)[source]

Function for batch update attribute in animals :param submission_id: id of submission :type submission_id: int :param animal_ids: set with ids to delete :type animal_ids: list

serializer = 'json'
store_errors_even_if_ignored = False
track_started = False
typing = True
class animals.tasks.BatchUpdateAnimals(*args, **kwargs)[source]

Bases: submissions.tasks.BatchUpdateMixin, common.tasks.NotifyAdminTaskMixin, common.tasks.BaseTask

action = 'batch update animals'
description = 'Batch update of field in animals'
ignore_result = False
item_cls

alias of uid.models.Animal

name = 'Batch update animals'
priority = None
rate_limit = None
reject_on_worker_lost = None
request_stack = <celery.utils.threads._LocalStack object>
run(submission_id, animal_ids, attribute)[source]

Function for batch update attribute in animals :param submission_id: id of submission :type submission_id: int :param animal_ids: dict with id and values to update :type animal_ids: dict :param attribute: attribute to update :type attribute: str

serializer = 'json'
store_errors_even_if_ignored = False
track_started = False
typing = True

animals.views

animals.views module contents

Created on Mon Feb 4 12:34:22 2019

@author: Paolo Cozzi <cozzi@ibba.cnr.it>

class animals.views.DeleteAnimalView(**kwargs)[source]

Bases: common.views.DeleteMaterialMixin, django.views.generic.edit.DeleteView

delete(request, *args, **kwargs)[source]

Calls the delete() method on the fetched object, does all stuff and then redirects to the success URL.

model

alias of uid.models.Animal

template_name = 'animals/animal_confirm_delete.html'
class animals.views.DetailAnimalView(**kwargs)[source]

Bases: common.views.DetailMaterialMixin, django.views.generic.detail.DetailView

model

alias of uid.models.Animal

template_name = 'animals/animal_detail.html'
class animals.views.ListAnimalView(**kwargs)[source]

Bases: common.views.ListMaterialMixin, django.views.generic.list.ListView

model

alias of uid.models.Animal

ordering = ['submission']
paginate_by = 10
template_name = 'animals/animal_list.html'
class animals.views.UpdateAnimalView(**kwargs)[source]

Bases: common.views.UpdateMaterialMixin, django.views.generic.edit.UpdateView

form_class

alias of animals.forms.UpdateAnimalForm

get_initial()[source]

Returns the initial data to use for forms on this view.

model

alias of uid.models.Animal

template_name = 'animals/animal_form.html'
validationresult_class

alias of validation.models.ValidationResult