Timed Mating Application

This package defines the timed_mating app.

Timed matings are a specific type of breeding set. Generally, for these experiments a mating cage is set up and pregnancy is defined by a plug event. Based on this information, the age of an embryo can be estimated. When a breeding cage is defined, one option is to set this cage as a timed mating cage (ie Timed_Mating=True). If this is the case, then a plug event can be registered and recorded for this mating set. If the mother gives birth then this cage is implicitly set as a normal breeding cage.

Timed Mating Data Models

This defines the data model for the timed_mating app.

Currently the only data model is for PlugEvents.

class mousedb.timed_mating.models.PlugEvents(*args, **kwargs)

This defines the model for PlugEvents.

A PlugEvent requires a date. All other fields are optional. Upon observation of a plug event, the PlugDate, Breeding Cage, Femalem, Male, Researcher and Notes can be set. Upon sacrifice of the mother, then genotyped alive and dead embryos can be entered, along with the SacrificeDate, Researcher and Notes.

get_absolute_url(*moreargs, **morekwargs)

The permalink for a plugevent is /mousedb/timed_mating/plugs/id.

save()

Over-rides the default save function for PlugEvents.

If a sacrifice date is set for an object in this model, then Active is set to False.

Timed Mating App Views and URLs

This urlconf sets the directions for the timed_mating app.

It takes a url in the form of /plug/something and sends it to the appropriate view class or function.

Views

This package defines custom views for the timed_mating application.

Currently all views are generic CRUD views except for the view in which a plug event is defined from a breeding cage.

class mousedb.timed_mating.views.PlugEventsCreate(**kwargs)

This class generates the plugevents-new view.

This permission restricted view takes a url in the form /plugs/new and generates an empty plugevents_form.html.

model

alias of PlugEvents

class mousedb.timed_mating.views.PlugEventsDelete(**kwargs)

This class generates the plugevents-delete view.

This permission restricted view takes a url in the form /plugs/#/delete and passes that object to the confirm_delete.html page.

model

alias of PlugEvents

class mousedb.timed_mating.views.PlugEventsDetail(**kwargs)

This class generates the plugevents-detail view.

This login protected takes a url in the form /plugs/1 for plug event id=1 and passes a plug object to plugevents_detail.html

model

alias of PlugEvents

class mousedb.timed_mating.views.PlugEventsList(**kwargs)

This class generates an object list for PlugEvent objects.

This login protected view takes all PlugEvents objects and sends them to plugevents_list.html as a plug_list dictionary. The url for this view is /plugs/

model

alias of PlugEvents

class mousedb.timed_mating.views.PlugEventsListStrain(**kwargs)

This class generates a strain filtered list for Plug Event objects.

This is a subclass of PlugEventsList and returns as context_object_name plug_events_list to plugevents_list.html. It takes a named argument (strain) which is a Strain_slug and filters based on that strain.

get_queryset()

The queryset is over-ridden to show only plug events in which the strain matches the breeding strain.

class mousedb.timed_mating.views.PlugEventsUpdate(**kwargs)

This class generates the plugevents-edit view.

This permission restricted view takes a url in the form /plugs/#/edit and generates a plugevents_form.html with that object.

model

alias of PlugEvents

mousedb.timed_mating.views.breeding_plugevent(request, *args, **kwargs)

This view defines a form for adding new plug events from a breeding cage.

This form requires a breeding_id from a breeding set and restricts the PlugFemale and PlugMale to animals that are defined in that breeding cage.

Administrative Interface

Settings to control the admin interface for the timed_mating app.

This file defines a PlugEventsAdmin object to enter parameters about individual plug events/

class mousedb.timed_mating.admin.PlugEventsAdmin(model, admin_site)

This class defines the admin interface for the PlugEvents model.

Timed Mating App Unit Tests

This file contains tests for the timed_mating application.

These tests will verify generation of a new PlugEvent object.

class mousedb.timed_mating.tests.Timed_MatingModelTests(methodName='runTest')

Test the models contained in the ‘timed_mating’ app.

setUp()

Instantiate the test client. Creates a test user.

tearDown()

Depopulate created model instances from test database.

test_create_plugevent_minimal()

This is a test for creating a new PlugEvent object, with only the minimum being entered.

test_create_plugevent_most_fields()

This is a test for creating a new PlugEvent object.

This test uses a Breeding, PlugDate, PlugMale and PlugFemale field.

test_set_plugevent_inactive()

This is a test for the automatic inactivation of a cage when the SacrificeDate is entered.

class mousedb.timed_mating.tests.Timed_MatingViewTests(methodName='runTest')

Test the views contained in the ‘timed_mating’ app.

setUp()

Instantiate the test client. Creates a test user.

tearDown()

Depopulate created model instances from test database.

test_breeding_plugevent_new()

This tests the breeding-plugevent-new view, ensuring that templates are loaded correctly.

This view uses a user with superuser permissions so does not test the permission levels for this view.

test_plugevent_delete()

This tests the plugevent-delete view, ensuring that templates are loaded correctly.

This view uses a user with superuser permissions so does not test the permission levels for this view.

test_plugevent_detail()

This tests the plugevent-detail view, ensuring that templates are loaded correctly.

This view uses a user with superuser permissions so does not test the permission levels for this view.

test_plugevent_edit()

This tests the plugevent-edit view, ensuring that templates are loaded correctly.

This view uses a user with superuser permissions so does not test the permission levels for this view.

test_plugevent_list()

This tests the plugevent-list view, ensuring that templates are loaded correctly.

This view uses a user with superuser permissions so does not test the permission levels for this view.

test_plugevent_list_strain()

This tests the plugevent-list-strain view, ensuring that templates are loaded correctly.

This view uses a user with superuser permissions so does not test the permission levels for this view.

test_plugevent_new()

This tests the plugevent-new view, ensuring that templates are loaded correctly.

This view uses a user with superuser permissions so does not test the permission levels for this view.

Timed Mating Utilities

This package describes forms used by the Timed Mating app.

class mousedb.timed_mating.forms.BreedingPlugForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.util.ErrorList'>, label_suffix=':', empty_permitted=False, instance=None)

This form is used to enter Plug Events from a specific breeding cage.