proso_flashcards package

Submodules

proso_flashcards.admin module

class proso_flashcards.admin.AnswerAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

asked_ago(a)[source]
is_correct(a)[source]
list_display = ('user', 'item_asked', 'item_answered', 'context', 'is_correct', 'options_count', 'type', 'time', 'asked_ago')
media
options_count(a)[source]
raw_id_fields = ('options',)
search_fields = ('user__username',)
class proso_flashcards.admin.CategoryAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('id', 'identifier', 'lang', 'name')
list_filter = ('lang',)
media
search_fields = ('name',)
class proso_flashcards.admin.ContextAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('id', 'identifier', 'lang', 'name')
list_filter = ('lang',)
media
search_fields = ('name',)
class proso_flashcards.admin.FlashcardAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('id', 'identifier', 'lang', 'term', 'context')
list_filter = ('lang',)
media
search_fields = ('identifier', 'term__name', 'context__name')
class proso_flashcards.admin.TermAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('id', 'identifier', 'lang', 'name')
list_filter = ('lang',)
media
search_fields = ('identifier', 'name')

proso_flashcards.flashcard_construction module

class proso_flashcards.flashcard_construction.ContextOptionSet(**kwargs)[source]

Bases: proso_flashcards.flashcard_construction.OptionSet

get_option_for_flashcards(flashcards_with_question_types)[source]
class proso_flashcards.flashcard_construction.Direction(**kwargs)[source]

Bases: object

get_direction(flashcard)[source]
class proso_flashcards.flashcard_construction.EmptyOptionSet(**kwargs)[source]

Bases: proso_flashcards.flashcard_construction.OptionSet

get_option_for_flashcards(flashcards_with_question_types)[source]
class proso_flashcards.flashcard_construction.OnlyFromDescriptionDirection(**kwargs)[source]

Bases: proso_flashcards.flashcard_construction.Direction

get_direction(flashcard)[source]
class proso_flashcards.flashcard_construction.OnlyFromTermDirection(**kwargs)[source]

Bases: proso_flashcards.flashcard_construction.Direction

get_direction(flashcard)[source]
class proso_flashcards.flashcard_construction.OptionSet(**kwargs)[source]

Bases: object

get_option_for_flashcards(flashcards_with_question_types)[source]
class proso_flashcards.flashcard_construction.RandomDirection(**kwargs)[source]

Bases: proso_flashcards.flashcard_construction.Direction

get_direction(flashcard)[source]
proso_flashcards.flashcard_construction.get_direction()[source]
proso_flashcards.flashcard_construction.get_option_set()[source]

proso_flashcards.json_enrich module

proso_flashcards.json_enrich.answer_flashcards(request, json_list, nested)[source]
proso_flashcards.json_enrich.answer_type(request, json_list, nested)[source]
proso_flashcards.json_enrich.context_flashcards(request, json_list, nested)[source]
proso_flashcards.json_enrich.options(request, json_list, nested)[source]
proso_flashcards.json_enrich.question_type(request, json_list, nested)[source]
proso_flashcards.json_enrich.remove_context_content(request, json_list, nested)[source]
proso_flashcards.json_enrich.remove_flashcard_context(request, json_list, nested)[source]

proso_flashcards.models module

class proso_flashcards.models.Category(id, identifier, item, lang, name, type)[source]

Bases: django.db.models.base.Model, proso.django.models.ModelDiffMixin

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Category.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

Category.objects = <django.db.models.manager.Manager object>
Category.to_json(nested=False)[source]
class proso_flashcards.models.Context(id, identifier, item, lang, name, content, active)[source]

Bases: django.db.models.base.Model, proso.django.models.ModelDiffMixin

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Context.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Context.extendedcontext

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

Context.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 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.

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

Context.objects = <proso_flashcards.models.ContextManager object>
Context.to_json(nested=False)[source]
class proso_flashcards.models.ContextManager[source]

Bases: django.db.models.manager.Manager

class proso_flashcards.models.Flashcard(id, identifier, item, lang, term, term_secondary, context, description, active, additional_info)[source]

Bases: django.db.models.base.Model, proso.django.models.ModelDiffMixin

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Flashcard.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Flashcard.answers_with_this_as_option

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 and topping.pizzas are ManyToManyDescriptor instances.

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

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

Flashcard.get_context()[source]
Flashcard.get_term()[source]
Flashcard.get_term_secondary()[source]
Flashcard.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 a ForwardManyToOneDescriptor instance.

Flashcard.objects = <proso_flashcards.models.FlashcardManager object>
static Flashcard.related_context()[source]
static Flashcard.related_term()[source]
static Flashcard.related_term_secondary()[source]
Flashcard.term

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

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

Flashcard.to_json(nested=False, contexts=True)[source]
class proso_flashcards.models.FlashcardAnswer(id, user, session, item, item_asked, item_answered, time, response_time, guess, config, context, metainfo, type, lang, practice_set, answer_ptr)[source]

Bases: proso_models.models.Answer

exception DoesNotExist

Bases: proso_models.models.DoesNotExist

FlashcardAnswer.FROM_DESCRIPTION = 'd2t'
FlashcardAnswer.FROM_TERM = 't2d'
FlashcardAnswer.FROM_TERM_SECONDARY_TO_TERM = 'ts2t'
FlashcardAnswer.FROM_TERM_TO_TERM_SECONDARY = 't2ts'
exception FlashcardAnswer.MultipleObjectsReturned

Bases: proso_models.models.MultipleObjectsReturned

FlashcardAnswer.answer_ptr

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

FlashcardAnswer.objects = <proso_flashcards.models.FlashcardAnswerManager object>
FlashcardAnswer.options

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 and topping.pizzas are ManyToManyDescriptor instances.

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

FlashcardAnswer.to_json(nested=False)[source]
class proso_flashcards.models.FlashcardAnswerManager[source]

Bases: django.db.models.manager.Manager

from_json(json_object, practice_context, practice_set, user_id, object_class=None)[source]
class proso_flashcards.models.FlashcardManager[source]

Bases: django.db.models.manager.Manager

prepare()[source]
class proso_flashcards.models.Term(id, identifier, item, lang, name)[source]

Bases: django.db.models.base.Model, proso.django.models.ModelDiffMixin

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Term.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Term.extendedterm

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

Term.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 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.

Term.flashcards_as_secondary

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.

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

Term.objects = <proso_flashcards.models.TermManager object>
Term.to_json(nested=False)[source]
class proso_flashcards.models.TermManager[source]

Bases: django.db.models.manager.Manager

proso_flashcards.models.add_parent(sender, instance, **kwargs)[source]

When a flashcard is created, create also an item relation.

proso_flashcards.models.change_activity(sender, instance, **kwargs)[source]
proso_flashcards.models.change_parent(sender, instance, **kwargs)[source]

When the given flashcard has changed. Look at term and context and change the corresponding item relation.

proso_flashcards.models.create_items(sender, instance, **kwargs)[source]

When one of the defined objects is created, initialize also its item.

proso_flashcards.models.delete_parent(sender, instance, **kwargs)[source]

When the given flashcard is deleted, delete also the corresponding item relations.

proso_flashcards.urls module

proso_flashcards.views module

proso_flashcards.views.show_more(request, object_class, should_cache=True)[source]
proso_flashcards.views.show_one(request, object_class, id)[source]

Module contents