pomodorr.projects package¶
Subpackages¶
Submodules¶
pomodorr.projects.admin module¶
-
class
pomodorr.projects.admin.
PriorityAdmin
(model, admin_site)¶ Bases:
django.contrib.admin.options.ModelAdmin
-
property
media
¶
-
property
-
class
pomodorr.projects.admin.
ProjectAdmin
(model, admin_site)¶ Bases:
django.contrib.admin.options.ModelAdmin
-
actions
= ['hard_delete', 'undo_delete']¶
-
get_queryset
(request)¶ Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
-
hard_delete
(request, queryset)¶
-
list_display
= ('name', 'user', 'priority', 'user_defined_ordering', 'is_removed')¶
-
list_filter
= ('is_removed',)¶
-
property
media
¶
-
search_fields
= ('user__username', 'name', 'color')¶
-
undo_delete
(request, queryset)¶
-
-
class
pomodorr.projects.admin.
SubTaskAdmin
(model, admin_site)¶ Bases:
django.contrib.admin.options.ModelAdmin
-
property
media
¶
-
property
-
class
pomodorr.projects.admin.
SubTaskInlineAdmin
(parent_model, admin_site)¶ Bases:
django.contrib.admin.options.StackedInline
-
property
media
¶
-
model
¶ alias of
pomodorr.projects.models.SubTask
-
property
pomodorr.projects.api module¶
-
class
pomodorr.projects.api.
PriorityViewSet
(**kwargs)¶ Bases:
rest_framework.viewsets.ModelViewSet
-
filter_backends
= [<class 'rest_framework.filters.OrderingFilter'>, <class 'django_filters.rest_framework.backends.DjangoFilterBackend'>]¶
-
filterset_fields
= {'name': ['exact', 'iexact', 'contains', 'icontains'], 'priority_level': ['exact', 'gt', 'gte', 'lt', 'lte']}¶
-
get_queryset
()¶ Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
-
get_serializer_context
()¶ Extra context provided to the serializer class.
-
http_method_names
= ['get', 'post', 'put', 'delete']¶
-
ordering_fields
= ['created_at', 'priority_level', 'name']¶
-
permission_classes
= (<class 'rest_framework.permissions.IsAuthenticated'>, <class 'pomodorr.tools.permissions.IsObjectOwner'>)¶
-
serializer_class
¶
-
-
class
pomodorr.projects.api.
ProjectsViewSet
(**kwargs)¶ Bases:
rest_framework.viewsets.ModelViewSet
-
filter_backends
= [<class 'rest_framework.filters.OrderingFilter'>, <class 'django_filters.rest_framework.backends.DjangoFilterBackend'>]¶
-
filterset_fields
= {'name': ['exact', 'iexact', 'contains', 'icontains'], 'priority__priority_level': ['exact', 'gt', 'gte', 'lt', 'lte']}¶
-
get_queryset
()¶ Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
-
get_serializer_context
()¶ Extra context provided to the serializer class.
-
http_method_names
= ['get', 'post', 'put', 'delete']¶
-
ordering_fields
= ['created_at', 'priority__priority_level', 'user_defined_ordering', 'name']¶
-
permission_classes
= (<class 'rest_framework.permissions.IsAuthenticated'>, <class 'pomodorr.tools.permissions.IsObjectOwner'>)¶
-
serializer_class
¶
-
-
class
pomodorr.projects.api.
SubTaskViewSet
(**kwargs)¶ Bases:
rest_framework.viewsets.ModelViewSet
-
filter_backends
= [<class 'rest_framework.filters.OrderingFilter'>, <class 'django_filters.rest_framework.backends.DjangoFilterBackend'>]¶
-
filterset_fields
= {'is_completed': ['exact'], 'name': ['exact', 'iexact', 'contains', 'icontains'], 'task__id': ['exact']}¶
-
get_queryset
()¶ Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
-
get_serializer_context
()¶ Extra context provided to the serializer class.
-
http_method_names
= ['get', 'post', 'put', 'delete']¶
-
ordering_fields
= ['created_at', 'name', 'is_completed']¶
-
permission_classes
= (<class 'rest_framework.permissions.IsAuthenticated'>, <class 'pomodorr.tools.permissions.IsSubTaskOwner'>)¶
-
serializer_class
¶
-
-
class
pomodorr.projects.api.
TaskViewSet
(**kwargs)¶ Bases:
rest_framework.viewsets.ModelViewSet
-
filter_backends
= [<class 'rest_framework.filters.OrderingFilter'>, <class 'django_filters.rest_framework.backends.DjangoFilterBackend'>]¶
-
filterset_fields
= {'name': ['exact', 'iexact', 'contains', 'icontains'], 'priority__priority_level': ['exact', 'gt', 'gte', 'lt', 'lte'], 'project__id': ['exact']}¶
-
get_queryset
()¶ Get the list of items for this view. This must be an iterable, and may be a queryset. Defaults to using self.queryset.
This method should always be used rather than accessing self.queryset directly, as self.queryset gets evaluated only once, and those results are cached for all subsequent requests.
You may want to override this if you need to provide different querysets depending on the incoming request.
(Eg. return a list of items that is specific to the user)
-
get_serializer_context
()¶ Extra context provided to the serializer class.
-
http_method_names
= ['get', 'post', 'put', 'delete']¶
-
ordering_fields
= ['created_at', 'priority__priority_level', 'user_defined_ordering', 'name']¶
-
permission_classes
= (<class 'rest_framework.permissions.IsAuthenticated'>, <class 'pomodorr.tools.permissions.IsTaskOwner'>)¶
-
serializer_class
¶
-
pomodorr.projects.apps module¶
pomodorr.projects.exceptions module¶
-
exception
pomodorr.projects.exceptions.
PriorityException
(message, code=None, params=None)¶ Bases:
django.core.exceptions.ValidationError
-
messages
= {'priority_duplicated': 'Priority name must be unique.'}¶
-
priority_duplicated
= 'priority_duplicated'¶
-
-
exception
pomodorr.projects.exceptions.
ProjectException
(message, code=None, params=None)¶ Bases:
django.core.exceptions.ValidationError
-
messages
= {'priority_does_not_exist': 'The chosen priority does not exist.', 'project_duplicated': 'Project name must be unique.'}¶
-
priority_does_not_exist
= 'priority_does_not_exist'¶
-
project_duplicated
= 'project_duplicated'¶
-
-
exception
pomodorr.projects.exceptions.
SubTaskException
(message, code=None, params=None)¶ Bases:
django.core.exceptions.ValidationError
-
cannot_change_task
= 'cannot_change_task'¶
-
messages
= {'cannot_change_task': 'The task cannot be changed once the sub task has been created.', 'sub_task_duplicated': 'There is already a sub task with identical name in the selected task.', 'task_already_completed': 'You cannot create sub tasks within completed tasks.', 'task_does_not_exist': 'The chosen task does not exist.'}¶
-
sub_task_duplicated
= 'sub_task_duplicated'¶
-
task_already_completed
= 'task_already_completed'¶
-
task_does_not_exist
= 'task_does_not_exist'¶
-
-
exception
pomodorr.projects.exceptions.
TaskException
(message, code=None, params=None)¶ Bases:
django.core.exceptions.ValidationError
-
already_active
= 'already_active'¶
-
already_completed
= 'already_completed'¶
-
invalid_due_date
= 'invalid_due_date'¶
-
invalid_duration
= 'invalid_duration'¶
-
messages
= {'already_active': 'The task is already active.', 'already_completed': 'The task is already completed.', 'invalid_due_date': 'Due date cannot be lesser than today.', 'invalid_duration': 'Repeat value has to be full days, weeks, months or years.', 'priority_does_not_exist': 'The chosen priority does not exist.', 'project_does_not_exist': 'The chosen project does not exist.', 'task_duplicated': 'There is already a task with identical name in the selected project.', 'wrong_status': 'Only active tasks can be created.'}¶
-
priority_does_not_exist
= 'priority_does_not_exist'¶
-
project_does_not_exist
= 'project_does_not_exist'¶
-
task_duplicated
= 'task_duplicated'¶
-
wrong_status
= 'wrong_status'¶
-
pomodorr.projects.models module¶
-
class
pomodorr.projects.models.
CustomManagerMixin
¶ Bases:
object
-
class
pomodorr.projects.models.
CustomSoftDeletableManager
¶ Bases:
pomodorr.projects.models.CustomManagerMixin
,django.db.models.manager.Manager
-
class
pomodorr.projects.models.
CustomSoftDeletableQueryset
(model=None, query=None, using=None, hints=None)¶ Bases:
django.db.models.query.QuerySet
-
delete
(soft=True)¶ Delete the records in the current QuerySet.
-
-
class
pomodorr.projects.models.
Priority
(id, name, priority_level, color, user, created_at)¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
color
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
created_at
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_next_by_created_at
(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)¶
-
get_previous_by_created_at
(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)¶
-
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
= <django.db.models.manager.Manager object>¶
-
priority_level
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
projects
¶ 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
tasks
¶ 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
user
¶ 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 aForwardManyToOneDescriptor
instance.
-
user_id
¶
-
exception
-
class
pomodorr.projects.models.
Project
(is_removed, id, name, priority, user_defined_ordering, user, created_at)¶ Bases:
model_utils.models.SoftDeletableModel
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
all_objects
= <pomodorr.projects.models.CustomSoftDeletableManager object>¶
-
created_at
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_next_by_created_at
(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)¶
-
get_previous_by_created_at
(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)¶
-
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.
-
priority
¶ 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 aForwardManyToOneDescriptor
instance.
-
priority_id
¶
-
tasks
¶ 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
user
¶ 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 aForwardManyToOneDescriptor
instance.
-
user_defined_ordering
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
user_id
¶
-
exception
-
class
pomodorr.projects.models.
SubTask
(id, name, task, created_at, is_completed)¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
created_at
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_next_by_created_at
(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)¶
-
get_previous_by_created_at
(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
is_completed
¶ 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
= <django.db.models.manager.Manager object>¶
-
task
¶ 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 aForwardManyToOneDescriptor
instance.
-
task_id
¶
-
exception
-
class
pomodorr.projects.models.
Task
(is_removed, id, name, status, priority, user_defined_ordering, pomodoro_number, pomodoro_length, break_length, due_date, reminder_date, repeat_duration, project, note, created_at)¶ Bases:
model_utils.models.SoftDeletableModel
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
STATUS_CHOICES
= [(0, 'active'), (1, 'completed')]¶
-
all_objects
= <pomodorr.projects.models.CustomSoftDeletableManager object>¶
-
break_length
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
created_at
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
due_date
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
frames
¶ 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
get_next_by_created_at
(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=True, **kwargs)¶
-
get_previous_by_created_at
(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)¶
-
get_status_display
(*, field=<django.db.models.fields.PositiveIntegerField: status>)¶
-
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.
-
property
normalized_break_length
¶
-
property
normalized_pomodoro_length
¶
-
note
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
pomodoro_length
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
pomodoro_number
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
priority
¶ 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 aForwardManyToOneDescriptor
instance.
-
priority_id
¶
-
project
¶ 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 aForwardManyToOneDescriptor
instance.
-
project_id
¶
-
reminder_date
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
repeat_duration
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
status
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
status_active
= 0¶
-
status_completed
= 1¶
-
sub_tasks
¶ 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
user_defined_ordering
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
pomodorr.projects.serializers module¶
-
class
pomodorr.projects.serializers.
PrioritySerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)¶ Bases:
rest_framework.serializers.ModelSerializer
-
class
Meta
¶ Bases:
object
-
fields
= ('id', 'name', 'priority_level', 'color', 'user')¶
-
model
¶ alias of
pomodorr.projects.models.Priority
-
-
check_priority_name_uniqueness
(data)¶
-
validate
(data)¶
-
class
-
class
pomodorr.projects.serializers.
ProjectSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)¶ Bases:
rest_framework.serializers.ModelSerializer
-
class
Meta
¶ Bases:
object
-
fields
= ('id', 'name', 'priority', 'user_defined_ordering', 'user')¶
-
model
¶ alias of
pomodorr.projects.models.Project
-
-
check_project_name_uniqueness
(data)¶
-
to_representation
(instance)¶ Object instance -> Dict of primitive datatypes.
-
validate
(data)¶
-
validate_priority
(value)¶
-
class
-
class
pomodorr.projects.serializers.
SubTaskSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)¶ Bases:
rest_framework.serializers.ModelSerializer
-
class
Meta
¶ Bases:
object
-
fields
= ('id', 'name', 'task', 'is_completed')¶
-
model
¶ alias of
pomodorr.projects.models.SubTask
-
-
check_sub_task_name_uniqueness
(data)¶
-
validate
(data)¶
-
validate_task
(value)¶
-
class
-
class
pomodorr.projects.serializers.
TaskSerializer
(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)¶ Bases:
rest_framework.serializers.ModelSerializer
-
class
Meta
¶ Bases:
object
-
fields
= ('id', 'name', 'status', 'project', 'priority', 'user_defined_ordering', 'pomodoro_number', 'pomodoro_length', 'break_length', 'due_date', 'reminder_date', 'repeat_duration', 'note', 'sub_tasks')¶
-
model
¶ alias of
pomodorr.projects.models.Task
-
-
check_task_name_uniqueness
(data)¶
-
to_representation
(instance)¶ Object instance -> Dict of primitive datatypes.
-
update
(instance, validated_data)¶
-
validate
(data)¶
-
validate_priority
(value)¶
-
validate_project
(value)¶
-
validate_status
(value)¶
-
class