messenger_users package

Submodules

messenger_users.admin module

messenger_users.apps module

class messenger_users.apps.MessengerUsersConfig(app_name, app_module)

Bases: django.apps.config.AppConfig

name = 'messenger_users'

messenger_users.forms module

class messenger_users.forms.CreateUserDataFormModel(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)

Bases: django.forms.models.ModelForm

class Meta

Bases: object

fields = ['data_key', 'data_value', 'user']
model

alias of messenger_users.models.UserData

base_fields = {'data_key': <django.forms.fields.CharField object>, 'data_value': <django.forms.fields.CharField object>, 'user': <django.forms.models.ModelChoiceField object>}
declared_fields = {}
property media
class messenger_users.forms.CreateUserFormModel(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)

Bases: django.forms.models.ModelForm

class Meta

Bases: object

fields = ['last_channel_id', 'backup_key', 'bot_id']
model

alias of messenger_users.models.User

base_fields = {'backup_key': <django.forms.fields.CharField object>, 'bot_id': <django.forms.fields.IntegerField object>, 'last_channel_id': <django.forms.fields.CharField object>}
declared_fields = {}
property media

messenger_users.models module

class messenger_users.models.Child(id, parent_user, name, dob, created)

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

created

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

dob

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(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, 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>
parent_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 a ForwardManyToOneDescriptor instance.

parent_user_id

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

class messenger_users.models.ChildData(id, child, data_key, data_value, timestamp)

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

child

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.

child_id

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

data_key

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

data_value

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_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=True, **kwargs)
get_previous_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, 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.

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

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

class messenger_users.models.Referral(id, user_shared, user_opened, ref_type, created_at)

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)
get_ref_type_display(*, field=<django.db.models.fields.CharField: ref_type>)
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>
ref_type

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

user_opened

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.

user_opened_id

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

user_shared

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.

user_shared_id

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

class messenger_users.models.User(*args, **kwargs)

Bases: django.db.models.base.Model

Describes users as we see them inside the messenger_users app.

>>> User(1,1,"back", username="test")
<User: User 1 with m_id: 1; username = test>
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

backup_key

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

bot_id

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

channel_id

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

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

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_next_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_at>, is_next=True, **kwargs)
get_previous_by_created_at(*, field=<django.db.models.fields.DateTimeField: created_at>, is_next=False, **kwargs)
get_previous_by_updated_at(*, field=<django.db.models.fields.DateTimeField: updated_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.

last_channel_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>
opened_ref

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.

shared_ref

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.

updated_at

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

useractivity

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.

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

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

username

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

class messenger_users.models.UserActivity(id, user, state, last_change)

Bases: django.db.models.base.Model

ACTIVE_SESSION = 'active_session'
AWAITED_ENOUGH = 'awaited_enough'
BROADCAST_START = 'broadcast_start'
DISPATCHED = 'dispatched'
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

END_FEEDBACK = 'end_feedback'
FINISH_REGISTER = 'finish_register'
FOLLOW_UP = 'follow_up'
GET_POST = 'get_post'
GIVE_FEEDBACK = 'give_feedback'
IN_REGISTRATION = 'in_registration'
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

NO_FEEDBACK = 'no_feedback'
NO_OPEN = 'no_open'
OPENED = 'opened'
OPEN_POST = 'open_post'
PRE_CHURN = 'pre_churn'
PRE_REGISTER = 'pre_register'
RECEIVE_USER_MESSAGE = 'receive_user_message'
SEND_BROADCAST = 'send_broadcast'
SET_PRE_CHURN = 'set_pre_churn'
START_REGISTER = 'start_register'
STATE_TYPES = [('pre_register', 'pre_register'), ('in_registration', 'in_registration'), ('user_dead', 'user_dead'), ('wait', 'wait'), ('user_query', 'user_query'), ('broadcast_start', 'broadcast_start'), ('timed_start', 'timed_start'), ('active_session', 'active_session'), ('pre_churn', 'pre_churn'), ('dispatched', 'dispatched'), ('opened', 'opened'), ('follow_up', 'follow_up')]
TIMED_START = 'timed_start'
TRANSITIONS = []
USER_DEAD = 'user_dead'
USER_DIE = 'decay'
USER_QUERY = 'user_query'
WAIT = 'wait'
WANT_ACTIVITY = 'want_activity'
get_next_by_last_change(*, field=<django.db.models.fields.DateTimeField: last_change>, is_next=True, **kwargs)
get_previous_by_last_change(*, field=<django.db.models.fields.DateTimeField: last_change>, is_next=False, **kwargs)
get_state_display(*, field=<django.db.models.fields.CharField: state>)
id

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

last_change

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>
on_enter_active_session(**kwargs)
state

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

user

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

user_id

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

class messenger_users.models.UserActivityLog(id, user, initial_state, final_state, timestamp, success)

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

final_state

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_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, is_next=True, **kwargs)
get_previous_by_timestamp(*, field=<django.db.models.fields.DateTimeField: timestamp>, 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.

initial_state

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>
success

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

timestamp

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

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

user_id

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

class messenger_users.models.UserData(id, user, data_key, data_value, created)

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

created

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

data_key

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

data_value

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(*, field=<django.db.models.fields.DateTimeField: created>, is_next=True, **kwargs)
get_previous_by_created(*, field=<django.db.models.fields.DateTimeField: created>, 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.

objects = <django.db.models.manager.Manager object>
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 a ForwardManyToOneDescriptor instance.

user_id

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

messenger_users.models.init_state_machine(instance, **kwargs)
messenger_users.models.track_activity(*args, **kwargs)

messenger_users.routers module

class messenger_users.routers.MessengerUsersRouter

Bases: object

allow_migrate(db, app_label, model_name=None, **hints)
allow_relation(obj1, obj2, **hints)
db_for_read(model, **hints)
db_for_write(model, **hints)

messenger_users.tests module

messenger_users.urls module

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

messenger_users.views module

class messenger_users.views.ChildDataViewSet(**kwargs)

Bases: rest_framework.viewsets.ModelViewSet

API endpoint that allows users to be viewed or edited.

basename = None
description = None
detail = None
name = None
queryset
serializer_class

alias of messenger_users.serializers.ChildDataSerializer

suffix = None
class messenger_users.views.ChildViewSet(**kwargs)

Bases: rest_framework.viewsets.ModelViewSet

API endpoint that allows users to be viewed or edited.

basename = None
description = None
detail = None
name = None
queryset
serializer_class

alias of messenger_users.serializers.ChildSerializer

suffix = None
class messenger_users.views.UserDataBulkView(**kwargs)

Bases: rest_framework_bulk.generics.ListBulkCreateAPIView

queryset
serializer_class

alias of UserDataListSerializer

class messenger_users.views.UserDataListSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)

Bases: rest_framework_bulk.drf3.serializers.BulkSerializerMixin, messenger_users.serializers.UserDataSerializer

class Meta

Bases: object

fields = '__all__'
list_serializer_class

alias of rest_framework_bulk.drf3.serializers.BulkListSerializer

model

alias of messenger_users.models.UserData

class messenger_users.views.UserDataViewSet(**kwargs)

Bases: rest_framework.viewsets.ModelViewSet

API endpoint that allows users to be viewed or edited.

basename = None
description = None
detail = None
name = None
queryset
serializer_class

alias of messenger_users.serializers.UserDataSerializer

suffix = None
class messenger_users.views.UserViewSet(**kwargs)

Bases: rest_framework.viewsets.ModelViewSet

API endpoint that allows users to be viewed or edited.

basename = None
description = None
detail = None
name = None
queryset
serializer_class

alias of messenger_users.serializers.UserSerializer

suffix = None
messenger_users.views.add_attribute(request, channel_id)
messenger_users.views.by_username(request, username)
messenger_users.views.childId_from_user_Id(request, user_id)
messenger_users.views.child_interaction(request)
messenger_users.views.get_last_action(request, user_id, *args, **kwargs)
messenger_users.views.get_old_interactions_by_user(self, request, *args, **kwargs)
messenger_users.views.get_referrals_count(request, username)
messenger_users.views.get_user_activity_status(self, request, *args, **kwargs)
messenger_users.views.last_interacted(request, id=None)
messenger_users.views.new_user(request)

Creates user from a request.

messenger_users.views.set_referral(request)

Makes a ref from a username and a ref value with user- prefixed username.

messenger_users.views.set_user_action(self, request, *args, **kwargs)
messenger_users.views.user_interaction(request)

Module contents