proso_models package¶
Submodules¶
proso_models.admin module¶
proso_models.json_enrich module¶
proso_models.models module¶
-
class
proso_models.models.
Answer
(id, user, session, item, item_asked, item_answered, time, response_time, guess, config, context, metainfo, type, lang, practice_set)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
Answer.
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
Answer.
answerexperimentsetup_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.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.
-
Answer.
audit_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.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.
-
Answer.
config
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Answer.
context
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Answer.
flashcardanswer
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
place.restaurant
is aReverseOneToOneDescriptor
instance.
-
Answer.
get_next_by_time
(*moreargs, **morekwargs)¶
-
Answer.
get_previous_by_time
(*moreargs, **morekwargs)¶
-
Answer.
item
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Answer.
item_answered
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Answer.
item_asked
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Answer.
metainfo
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Answer.
objects
= <proso_models.models.AnswerManager object>¶
-
Answer.
practice_set
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Answer.
session
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Answer.
taskanswer
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
place.restaurant
is aReverseOneToOneDescriptor
instance.
-
Answer.
user
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Answer.
variable_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.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.
-
exception
-
class
proso_models.models.
AnswerMeta
(id, content, content_hash)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
AnswerMeta.
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
AnswerMeta.
answer_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.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.
-
AnswerMeta.
objects
= <proso_models.models.AnswerMetaManager object>¶
-
exception
-
class
proso_models.models.
Audit
(id, user, item_primary, item_secondary, key, value, time, info, answer)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
Audit.
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
Audit.
answer
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Audit.
get_next_by_time
(*moreargs, **morekwargs)¶
-
Audit.
get_previous_by_time
(*moreargs, **morekwargs)¶
-
Audit.
info
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Audit.
item_primary
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Audit.
item_secondary
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Audit.
objects
= <django.db.models.manager.Manager object>¶
-
Audit.
user
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
exception
-
class
proso_models.models.
EnvironmentInfo
(id, status, revision, config, load_progress, updated, created)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
EnvironmentInfo.
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
EnvironmentInfo.
STATUS
= ((0, 'disabled'), (1, 'loading'), (2, 'enabled'), (3, 'active'))¶
-
EnvironmentInfo.
STATUS_ACTIVE
= 3¶
-
EnvironmentInfo.
STATUS_DISABLED
= 0¶
-
EnvironmentInfo.
STATUS_ENABLED
= 2¶
-
EnvironmentInfo.
STATUS_LOADING
= 1¶
-
EnvironmentInfo.
audit_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.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.
-
EnvironmentInfo.
config
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
EnvironmentInfo.
get_next_by_created
(*moreargs, **morekwargs)¶
-
EnvironmentInfo.
get_next_by_updated
(*moreargs, **morekwargs)¶
-
EnvironmentInfo.
get_previous_by_created
(*moreargs, **morekwargs)¶
-
EnvironmentInfo.
get_previous_by_updated
(*moreargs, **morekwargs)¶
-
EnvironmentInfo.
get_status_display
(*moreargs, **morekwargs)¶
-
EnvironmentInfo.
objects
= <django.db.models.manager.Manager object>¶
-
EnvironmentInfo.
variable_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.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.
-
exception
-
class
proso_models.models.
EnvironmentItemUpdateDirection
(key, correct_increases=True, size=100)[source]¶
-
class
proso_models.models.
EnvironmentUserUpdateDirection
(key, correct_increases=True, size=1000)[source]¶
-
class
proso_models.models.
Item
(id, item_type, active)[source]¶ Bases:
django.db.models.base.Model
,proso.django.models.ModelDiffMixin
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
Item.
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
Item.
child_relations
¶ 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.
-
Item.
children
¶ 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.toppings
andtopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
Item.
flashcard_categories
¶ 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.
-
Item.
flashcard_contexts
¶ 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.
-
Item.
flashcard_terms
¶ 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.
-
Item.
flashcards
¶ 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.
-
Item.
item_answered_answers
¶ 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.
-
Item.
item_answers
¶ 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.
-
Item.
item_asked_answers
¶ 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.
-
Item.
item_primary_audits
¶ 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.
-
Item.
item_primary_variables
¶ 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.
-
Item.
item_secondary_audits
¶ 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.
-
Item.
item_secondary_variables
¶ 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.
-
Item.
item_type
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Item.
objects
= <proso_models.models.ItemManager object>¶
-
Item.
parent_relations
¶ 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.
-
Item.
parents
¶ 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.toppings
andtopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
Item.
task_contexts
¶ 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.
-
Item.
task_instances
¶ 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.
-
Item.
task_skills
¶ 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.
-
Item.
task_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.
-
exception
-
class
proso_models.models.
ItemManager
[source]¶ Bases:
django.db.models.manager.Manager
-
filter_all_reachable_leaves
(identifier_filter, language)[source]¶ Get all leaves corresponding to the given filter:
- the filter is a list of lists;
- each of the inner list carries identifiers;
- for each identifier, we find an item and all its reachable leaf items;
- within the inner list we union the reachable items;
- with the outer list we intersect the reachable items;
- when an identifier starts with the prfix ‘-‘, we find its reachable leaf items and then complement them
Example:
A / \ B C / \ / \ D E F [[A], [C]] ----> [D, F] [[B], [C]] ----> [E] [[B], [-C]] ---> [D] [[A], [-D], [-F]] ---> [E] [[-C]] ---> []
- Args::
- identifier_filter (list): list of lists of identifiers (some of them
- can start with the prefix ‘-‘)
- language (str): language used for further filtering (some objects
- for different languages share the same item
Returns: list of item ids Return type: list
-
filter_all_reachable_leaves_many
(identifier_filters, language)[source]¶ Provides the same functionality as .. py:method:: ItemManager.filter_all_reachable_leaves(), but for more filters in the same time.
Parameters: - identifier_filters – list of identifier filters
- language (str) – language used for further filtering (some objects for different languages share the same item
Returns: list of list of item ids
Return type:
-
get_all_leaves
(item_ids, language=None)[source]¶ Get all leaves reachable from the given set of items. Leaves having inactive relations to other items are omitted.
Parameters: - item_ids (list) – items which are taken as roots for the reachability
- language (str) – if specified, filter out items which are not available in the given language
Returns: leaf items which are reachable from the given set of items
Return type: set
-
get_children_graph
(item_ids=None, language=None)[source]¶ Get a subgraph of items reachable from the given set of items through the ‘child’ relation.
Parameters: - item_ids (list) – items which are taken as roots for the reachability
- language (str) – if specified, filter out items which are not available in the given language
Returns: item id -> list of items (child items), root items are referenced by None key
Return type:
-
get_item_type_id_from_identifier
(identifier, item_types=None)[source]¶ Get an ID of item type for the given identifier. Identifier is a string of the following form:
<model_prefix>/<model_identifier>
where <model_prefix> is any suffix of database table of the given model which uniquely specifies the table, and <model_identifier> is identifier of the object.
Parameters: - identifier (str) – item identifier
- item_types (dict) – ID -> item type JSON
Returns: ID of the corresponding item type
Return type: int
-
get_leaves
(item_ids, language=None)[source]¶ Get mapping of items to their reachable leaves. Leaves having inactive relations to other items are omitted.
Parameters: - item_ids (list) – items which are taken as roots for the reachability
- language (str) – if specified, filter out items which are not available in the given language
Returns: item id -> list of items (reachable leaves)
Return type:
-
get_parents_graph
(item_ids, language=None)[source]¶ Get a subgraph of items reachable from the given set of items through the ‘parent’ relation.
Parameters: - item_ids (list) – items which are taken as roots for the reachability
- language (str) – if specified, filter out items which are not available in the given language
Returns: item id -> list of items (parent items), root items are referenced by None key
Return type:
-
get_reference_fields
(exclude_models=None)[source]¶ Get all Django model fields which reference the Item model.
-
override_children_subgraph
(children_subgraph, invisible_edges=None)[source]¶ Get all items with outcoming edges from the given subgraph, drop all their child relations, and then add children according to the given subgraph.
Parameters: - children_subgraph (dict) – item id -> list of chidlren (item ids)
- invisible_edges (list|set) – set of (from, to) tuples specifying invisible edges
-
override_parent_subgraph
(parent_subgraph, invisible_edges=None)[source]¶ Get all items with outcoming edges from the given subgraph, drop all their parent relations, and then add parents according to the given subgraph.
Parameters: - parent_subgraph (dict) – item id -> list of parents(item ids)
- invisible_edges (list|set) – set of (from, to) tuples specifying invisible edges
-
translate_identifiers
(identifiers, language)[source]¶ Translate a list of identifiers to item ids. Identifier is a string of the following form:
<model_prefix>/<model_identifier>
where <model_prefix> is any suffix of database table of the given model which uniquely specifies the table, and <model_identifier> is identifier of the object.
Parameters: - identifiers (list[str]) – list of identifiers
- language (str) – language used for further filtering (some objects for different languages share the same item
Returns: identifier -> item id
Return type:
-
translate_item_ids
(item_ids, language, is_nested=None)[source]¶ Translate a list of item ids to JSON objects which reference them.
Parameters: - item_ids (list[int]) – item ids
- language (str) – language used for further filtering (some objects for different languages share the same item)
- is_nested (function) – mapping from item ids to booleans, where the boolean value indicates whether the item is nested
Returns: item id -> JSON object
Return type:
-
-
class
proso_models.models.
ItemRelation
(id, parent, child, visible, active)[source]¶ Bases:
django.db.models.base.Model
,proso.django.models.ModelDiffMixin
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
ItemRelation.
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
ItemRelation.
child
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
ItemRelation.
objects
= <django.db.models.manager.Manager object>¶
-
ItemRelation.
parent
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
exception
-
class
proso_models.models.
ItemType
(id, model, table, foreign_key, language, valid)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
ItemType.
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
ItemType.
item_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.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.
-
ItemType.
objects
= <proso_models.models.ItemTypeManager object>¶
-
exception
-
class
proso_models.models.
PracticeContext
(id, content, content_hash)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
PracticeContext.
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
PracticeContext.
answer_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.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.
-
PracticeContext.
objects
= <proso_models.models.PracticeContextManager object>¶
-
exception
-
class
proso_models.models.
PracticeSet
(id, finished)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
PracticeSet.
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
PracticeSet.
answer_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.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.
-
PracticeSet.
objects
= <django.db.models.manager.Manager object>¶
-
exception
-
class
proso_models.models.
Variable
(id, user, item_primary, item_secondary, permanent, key, value, audit, updated, info, answer)[source]¶ Bases:
django.db.models.base.Model
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
Variable.
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
Variable.
answer
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Variable.
get_next_by_updated
(*moreargs, **morekwargs)¶
-
Variable.
get_previous_by_updated
(*moreargs, **morekwargs)¶
-
Variable.
info
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Variable.
item_primary
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Variable.
item_secondary
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
Variable.
objects
= <django.db.models.manager.Manager object>¶
-
Variable.
user
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
child.parent
is aForwardManyToOneDescriptor
instance.
-
exception
-
proso_models.models.
learning_curve
(length, context=None, users=None, user_length=None, number_of_users=1000)[source]¶
proso_models.urls module¶
proso_models.views module¶
-
proso_models.views.
answer
(request)[source]¶ Save the answer.
- GET parameters:
- html:
- turn on the HTML version of the API
BODY json in following format: {
“answer”: #answer, – for one answer “answers”: [#answer, #answer, #answer ...] – for multiple answers}
- answer = {
“answer_class”: str, – class of answer to save (e.g., flashcard_answer) “response_time”: int, – response time in milliseconds “meta”: “str” – optional information “time_gap”: int – waiting time in frontend in seconds ... – other fields depending on aswer type
(see from_json method of Django model class)
}
-
proso_models.views.
learning_curve
(request)[source]¶ Shows a learning curve based on the randomized testing.
- GET parameters:
- length:
- length of the learning curve
- context:
- JSON representing the practice context
- all_users:
- if present stop filtering users based on the minimal number of testing answers (=length)
-
proso_models.views.
practice
(request)[source]¶ Return the given number of questions to practice adaptively. In case of POST request, try to save the answer(s).
- GET parameters:
- filter:
- list of lists of identifiers (may be prefixed by minus sign to mark complement)
- language:
- language (str) of items
- avoid:
- list of item ids to avoid
- limit:
- number of returned questions (default 10, maximum 100)
- time:
- time in format ‘%Y-%m-%d_%H:%M:%S’ used for practicing
- user:
- identifier for the practicing user (only for stuff users)
- stats:
- turn on the enrichment of the objects by some statistics
- html:
- turn on the HTML version of the API
- BODY:
- see answer resource
-
proso_models.views.
recommend_users
(request)[source]¶ Recommend users for further analysis.
- GET parameters:
- register_min:
- minimal date of user’s registration (‘%Y-%m-%d’)
- register_max:
- maximal date of user’s registration (‘%Y-%m-%d’)
- number_of_answers_min:
- minimal number of user’s answers
- number_of_answers_max:
- maximal number of user’s answers
- success_min:
- minimal user’s success rate
- success_max:
- maximal user’s success rate
- variable_name:
- name of the filtered parameter
- variable_min:
- minimal value of the parameter of the model
- variable_max:
- maximal value of parameter of the model
- limit:
- number of returned questions (default 10, maximum 100)
-
proso_models.views.
to_practice_counts
(request)[source]¶ Get number of items available to practice.
- filters: – use this or body
- json as in BODY
- language:
- language of the items
- BODY
json in following format: {
“#identifier”: [] – custom identifier (str) and filter ...}
-
proso_models.views.
user_stats
(request)[source]¶ Get user statistics for selected groups of items
- time:
- time in format ‘%Y-%m-%d_%H:%M:%S’ used for practicing
- user:
- identifier of the user (only for stuff users)
- username:
- username of user (only for users with public profile)
- filters: – use this or body
- json as in BODY
- mastered:
- use model to compute number of mastered items - can be slowed
- language:
- language of the items
- BODY
json in following format: {
“#identifier”: [] – custom identifier (str) and filter ...}