proso_user package

Submodules

proso_user.0006_migrate_to_psa module

class proso_user.0006_migrate_to_psa.Migration(name, app_label)[source]

Bases: django.db.migrations.migration.Migration

dependencies = [('auth', '__first__'), ('proso_user', '0005_auto_user_questions'), ('default', '0001_initial')]
operations = [<CreateModel options={'db_table': 'social_auth_code'}, bases=(<class 'django.db.models.base.Model'>, <class 'social.storage.django_orm.DjangoCodeMixin'>), fields=[('id', <django.db.models.fields.AutoField>), ('email', <django.db.models.fields.EmailField>), ('code', <django.db.models.fields.CharField>), ('verified', <django.db.models.fields.BooleanField>)], name='Code'>, <AlterUniqueTogether name='code', unique_together={('email', 'code')}>]

proso_user.admin module

class proso_user.admin.ClassAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

formfield_for_foreignkey(db_field, request=None, **kwargs)[source]
formfield_for_manytomany(db_field, request=None, **kwargs)[source]
list_display = ('code', 'name')
media
search_fields = ('code', 'name')
class proso_user.admin.SessionAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('user', 'time_zone', 'http_user_agent', 'location', 'locale', 'display_width', 'display_height')
list_filter = ('time_zone', 'locale')
media
search_fields = ('user__username',)
class proso_user.admin.UserProfileAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('user', 'send_emails', 'public')
media
search_fields = ('user__username',)
class proso_user.admin.UserProfilePropertyAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('user_profile', 'name', 'value')
list_filter = ('name',)
media
search_fields = ('user_profile__user__username', 'name')

proso_user.json_enrich module

proso_user.json_enrich.url(request, json_list, nested)[source]
proso_user.json_enrich.user_answers(request, json_list, nested)[source]

proso_user.models module

class proso_user.models.Class(id, code, name, owner)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Class.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Class.members

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.

Class.objects = <proso_user.models.ClassManager object>
Class.owner

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.

Class.to_json(nested=False, members=False)[source]
class proso_user.models.ClassManager[source]

Bases: django.db.models.manager.Manager

class proso_user.models.HttpUserAgent(id, content, content_hash, device_family, os_family, os_version, browser_family, browser_version)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception HttpUserAgent.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

HttpUserAgent.objects = <proso_user.models.HttpUserAgentManager object>
HttpUserAgent.session_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 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.

HttpUserAgent.to_json(nested=False)[source]
class proso_user.models.HttpUserAgentManager[source]

Bases: django.db.models.manager.Manager

from_content(content)[source]
class proso_user.models.Location(id, ip_address)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Location.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Location.get_country()[source]
Location.objects = <proso_user.models.LocationManager object>
Location.session_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 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.

Location.to_json(nested=False)[source]
class proso_user.models.LocationManager[source]

Bases: django.db.models.manager.Manager

from_ip_address(ip_address)[source]
class proso_user.models.Session(id, user, time_zone, http_user_agent, location, locale, display_width, display_height)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Session.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

Session.comment_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 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.

Session.http_user_agent

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.

Session.location

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.

Session.objects = <proso_user.models.SessionManager object>
Session.subscription_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 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.

Session.time_zone

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.

Session.to_json(nested=False)[source]
Session.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 a ForwardManyToOneDescriptor instance.

class proso_user.models.SessionManager[source]

Bases: django.db.models.manager.Manager

get_current_session()[source]
get_current_session_id()[source]
reset_current_session()[source]
class proso_user.models.TimeZone(id, content, content_hash)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception TimeZone.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

TimeZone.objects = <proso_user.models.TimeZoneManager object>
TimeZone.session_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 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.

TimeZone.to_json(nested=False)[source]
class proso_user.models.TimeZoneManager[source]

Bases: django.db.models.manager.Manager

from_content(content)[source]
class proso_user.models.UserProfile(id, user, send_emails, public)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception UserProfile.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

UserProfile.classes

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.

UserProfile.objects = <django.db.models.manager.Manager object>
UserProfile.owned_classes

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.

UserProfile.save_properties(properties_json)[source]
UserProfile.to_json(nested=False, stats=False)[source]
UserProfile.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 a ForwardManyToOneDescriptor instance.

UserProfile.userprofileproperty_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 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.

class proso_user.models.UserProfileProperty(id, user_profile, name, value)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception UserProfileProperty.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

UserProfileProperty.objects = <django.db.models.manager.Manager object>
UserProfileProperty.user_profile

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.

class proso_user.models.UserQuestion(id, identifier, lang, content, active, answer_type, repeat)[source]

Bases: django.db.models.base.Model

ANSWER_TYPES = (('c', 'closed'), ('m', 'mixed'), ('o', 'open'))
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception UserQuestion.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

UserQuestion.TYPE_CLOSED = 'c'
UserQuestion.TYPE_MIXED = 'm'
UserQuestion.TYPE_OPEN = 'o'
UserQuestion.conditions

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.

UserQuestion.get_answer_type_display(*moreargs, **morekwargs)
UserQuestion.objects = <proso_user.models.UserQuestionManager object>
UserQuestion.on_events

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.

UserQuestion.possible_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 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.

UserQuestion.to_json(nested=False)[source]
UserQuestion.user_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 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.

class proso_user.models.UserQuestionAnswer(id, user, closed_answer, open_answer, time, question)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception UserQuestionAnswer.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

UserQuestionAnswer.get_next_by_time(*moreargs, **morekwargs)
UserQuestionAnswer.get_previous_by_time(*moreargs, **morekwargs)
UserQuestionAnswer.objects = <django.db.models.manager.Manager object>
UserQuestionAnswer.question

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.

UserQuestionAnswer.to_json(nested=False)[source]
UserQuestionAnswer.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 a ForwardManyToOneDescriptor instance.

class proso_user.models.UserQuestionCondition(id, type, value)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception UserQuestionCondition.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

UserQuestionCondition.objects = <proso_user.models.UserQuestionConditionManager object>
UserQuestionCondition.to_json(nested=False)[source]
UserQuestionCondition.userquestion_set

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.

class proso_user.models.UserQuestionConditionManager[source]

Bases: django.db.models.manager.Manager

from_type_value(type, value)[source]
class proso_user.models.UserQuestionEvent(id, type, value)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception UserQuestionEvent.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

UserQuestionEvent.objects = <proso_user.models.UserQuestionEventManager object>
UserQuestionEvent.to_json(nested=False)[source]
UserQuestionEvent.userquestion_set

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.

class proso_user.models.UserQuestionEventManager[source]

Bases: django.db.models.manager.Manager

from_type_value(type, value)[source]
class proso_user.models.UserQuestionManager[source]

Bases: django.db.models.manager.Manager

questions_to_ask(user_id, language)[source]
class proso_user.models.UserQuestionPossibleAnswer(id, identifier, active, content, question)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception UserQuestionPossibleAnswer.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

UserQuestionPossibleAnswer.objects = <django.db.models.manager.Manager object>
UserQuestionPossibleAnswer.question

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.

UserQuestionPossibleAnswer.to_json(nested=False)[source]
UserQuestionPossibleAnswer.userquestionanswer_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 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.

proso_user.models.create_class_code(sender, instance, created=False, **kwargs)[source]
proso_user.models.drop_lazy_user(sender, instance, created=False, **kwargs)[source]
proso_user.models.get_content_hash(content)[source]
proso_user.models.get_user_id(request, allow_override=False)[source]
proso_user.models.init_content_hash(instance)[source]
proso_user.models.init_content_hash_http_user_agent(sender, instance, **kwargs)[source]
proso_user.models.init_content_hash_time_zone(sender, instance, **kwargs)[source]
proso_user.models.init_session_http_user_agent(sender, instance, **kwargs)[source]
proso_user.models.init_session_location(sender, instance, **kwargs)[source]
proso_user.models.init_user_profile(sender, instance, created=False, **kwargs)[source]
proso_user.models.init_username(sender, user, **kwargs)[source]
proso_user.models.is_user_id_overridden(request, allow_override=False)[source]
proso_user.models.migrate_google_openid_user(user)[source]

proso_user.urls module

proso_user.views module

proso_user.views.answer_question(request)[source]
proso_user.views.initmobile_view(request)[source]

Create lazy user with a password. Used from the Android app. Also returns csrf token.

GET parameters:
username:
user’s name
password:
user’s password
proso_user.views.login(request)[source]

Log in

GET parameters:
html
turn on the HTML version of the API
POST parameters (JSON):
username:
user’s name
password:
user’s password
proso_user.views.logout(request)[source]
proso_user.views.profile(request, status=200)[source]

Get the user’s profile. If the user has no assigned profile, the HTTP 404 is returned. Make a POST request to modify the user’s profile.

GET parameters:
html
turn on the HTML version of the API
username:
username of user (only for users with public profile)
stats:
attache addition user statistics
POST parameters (JSON):
send_emails:
switcher turning on sending e-mails to user
public:
swicher making the user’s profile publicly available
user:
password:
user’s password
password_check:
user’s password again to check it
first_name (optional):
user’s first name
last_name (optional):
user’s last name
proso_user.views.questions_to_ask(request)[source]
proso_user.views.session(request)[source]

Get the information about the current session or modify the current session.

GET parameters:
html
turn on the HTML version of the API
POST parameters:
locale:
client’s locale
time_zone:
client’s time zone
display_width:
width of the client’s display
display_height
height of the client’s display
proso_user.views.show_more(request, object_class, should_cache=True)[source]
proso_user.views.show_one(request, object_class, id)[source]
proso_user.views.signup(request)[source]

Create a new user with the given credentials.

GET parameters:
html
turn on the HTML version of the API
POST parameters (JSON):
username:
user’s name
email:
user’s e-mail
password:
user’s password
password_check:
user’s password again to check it
first_name (optional):
user’s first name
last_name (optional):
user’s last name
proso_user.views.user_service(request)[source]

Module contents