pangea.contrib.tagging package

Submodules

pangea.contrib.tagging.admin module

class pangea.contrib.tagging.admin.TagAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('name', 'payload')
media
class pangea.contrib.tagging.admin.TagTagAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('tag', 'other_tag', 'payload')
media

pangea.contrib.tagging.apps module

class pangea.contrib.tagging.apps.TaggingConfig(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

name = 'tagging'

pangea.contrib.tagging.models module

class pangea.contrib.tagging.models.GenericTagRelationship(*args, **kwargs)[source]

Bases: pangea.core.mixins.AutoCreatedUpdatedMixin

class Meta[source]

Bases: object

abstract = False
payload

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class pangea.contrib.tagging.models.SampleGroupTagRelationship(id, created_at, updated_at, payload, tag, sample_group)[source]

Bases: pangea.contrib.tagging.models.GenericTagRelationship

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
sample_group

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 a ForwardManyToOneDescriptor instance.

sample_group_id
tag

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 a ForwardManyToOneDescriptor instance.

tag_id
class pangea.contrib.tagging.models.SampleTagRelationship(id, created_at, updated_at, payload, tag, sample)[source]

Bases: pangea.contrib.tagging.models.GenericTagRelationship

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
sample

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 a ForwardManyToOneDescriptor instance.

sample_id
tag

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 a ForwardManyToOneDescriptor instance.

tag_id
class pangea.contrib.tagging.models.Tag(*args, **kwargs)[source]

Bases: pangea.core.mixins.AutoCreatedUpdatedMixin

This class represents the sample model.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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 a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
payload

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

related_tags

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 a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

tag_sample(sample, payload='')[source]
tag_sample_group(sample_group, payload='')[source]
tagged_sample_groups

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 a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

tagged_samples

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 a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

uuid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class pangea.contrib.tagging.models.TagTagRelationship(id, created_at, updated_at, payload, tag, other_tag)[source]

Bases: pangea.contrib.tagging.models.GenericTagRelationship

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
other_tag

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 a ForwardManyToOneDescriptor instance.

other_tag_id
tag

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 a ForwardManyToOneDescriptor instance.

tag_id

pangea.contrib.tagging.serializers module

class pangea.contrib.tagging.serializers.TagAddSampleGroupSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]

Bases: rest_framework.serializers.Serializer

class pangea.contrib.tagging.serializers.TagAddSampleSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]

Bases: rest_framework.serializers.Serializer

class pangea.contrib.tagging.serializers.TagAddTagSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]

Bases: rest_framework.serializers.Serializer

class pangea.contrib.tagging.serializers.TagSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]

Bases: rest_framework.serializers.ModelSerializer

class Meta[source]

Bases: object

fields = ('uuid', 'name', 'created_at', 'updated_at', 'payload')
model

alias of pangea.contrib.tagging.models.Tag

pangea.contrib.tagging.tests module

Test suite for Sample model.

class pangea.contrib.tagging.tests.TagApiTests(methodName='runTest')[source]

Bases: rest_framework.test.APITestCase

classmethod setUpTestData()[source]

Load initial data for the TestCase.

test_auth_tag_private_sample()[source]
test_auth_tag_private_sample_group()[source]
test_create_tag()[source]

Ensure authorized user can create sample group.

test_read_tagged_sample_groups()[source]
test_read_tagged_samples()[source]
test_tag_public_sample()[source]
test_tag_public_sample_group()[source]
test_tag_read()[source]

Ensure no login is required to read a tag.

test_tag_tag()[source]
test_unauth_tag_private_sample()[source]
test_unauth_tag_private_sample_group()[source]
class pangea.contrib.tagging.tests.TagModelTests(methodName='runTest')[source]

Bases: django.test.testcases.TestCase

Test suite for Sample model.

test_add_tag()[source]
test_add_tag_with_payload()[source]
test_relate_tag_pair()[source]
test_relate_tag_triple()[source]
test_tag_sample()[source]

Ensure we can tag a sample group.

test_tag_sample_and_group()[source]

Ensure we can tag a sample group.

test_tag_sample_group()[source]

Ensure we can tag a sample group.

pangea.contrib.tagging.urls module

pangea.contrib.tagging.urls.path(route, view, kwargs=None, name=None, *, Pattern=<class 'django.urls.resolvers.RoutePattern'>)

pangea.contrib.tagging.views module

class pangea.contrib.tagging.views.TagCreateView(**kwargs)[source]

Bases: pangea.core.views.utils.PermissionedListCreateAPIView

filterset_fields = ['uuid', 'name']
permission_classes = (<class 'rest_framework.permissions.IsAuthenticatedOrReadOnly'>,)
queryset
serializer_class

alias of pangea.contrib.tagging.serializers.TagSerializer

class pangea.contrib.tagging.views.TagDetailsView(**kwargs)[source]

Bases: rest_framework.generics.RetrieveUpdateDestroyAPIView

This class handles the http GET, PUT and DELETE requests.

permission_classes = (<class 'rest_framework.permissions.IsAuthenticatedOrReadOnly'>,)
queryset
serializer_class

alias of pangea.contrib.tagging.serializers.TagSerializer

class pangea.contrib.tagging.views.TagSampleGroupsView(**kwargs)[source]

Bases: rest_framework.generics.ListAPIView

This class handles tagging sample groups.

filter_queryset(queryset)[source]

Given a queryset, filter it with whichever filter backend is in use.

You are unlikely to want to override this method, although you may need to call it either from a list view, or from a custom get_object method if you want to apply the configured filtering backend to the default queryset.

get_serializer_class()[source]

Return the class to use for the serializer. Defaults to using self.serializer_class.

You may want to override this if you need to provide different serializations depending on the incoming request.

(Eg. admins get full serialization, others get basic serialization)

permission_classes = (<class 'rest_framework.permissions.IsAuthenticatedOrReadOnly'>,)
post(request, *args, **kwargs)[source]
queryset
class pangea.contrib.tagging.views.TagSamplesView(**kwargs)[source]

Bases: rest_framework.generics.ListAPIView

This class handles tagging samples.

filter_queryset(queryset)[source]

Given a queryset, filter it with whichever filter backend is in use.

You are unlikely to want to override this method, although you may need to call it either from a list view, or from a custom get_object method if you want to apply the configured filtering backend to the default queryset.

get_serializer_class()[source]

Return the class to use for the serializer. Defaults to using self.serializer_class.

You may want to override this if you need to provide different serializations depending on the incoming request.

(Eg. admins get full serialization, others get basic serialization)

permission_classes = (<class 'rest_framework.permissions.IsAuthenticatedOrReadOnly'>,)
post(request, *args, **kwargs)[source]
queryset
class pangea.contrib.tagging.views.TagTagsView(**kwargs)[source]

Bases: rest_framework.generics.ListAPIView

This class handles managing membership of sample groups within projects.

get_serializer_class()[source]

Return the class to use for the serializer. Defaults to using self.serializer_class.

You may want to override this if you need to provide different serializations depending on the incoming request.

(Eg. admins get full serialization, others get basic serialization)

permission_classes = (<class 'rest_framework.permissions.IsAuthenticatedOrReadOnly'>,)
post(request, *args, **kwargs)[source]
queryset

Module contents