models Package

models Package

persona Module

class kawaz.core.personas.models.persona.ActivePersonaManager[ソース]

ベースクラス: kawaz.core.personas.models.persona.PersonaManager

アクティブユーザーのみを取り出すManager

get_queryset()[ソース]
class kawaz.core.personas.models.persona.Persona(*args, **kwargs)[ソース]

ベースクラス: django.contrib.auth.models.AbstractUser

Kawazで利用する認証用カスタムユーザーモデル

このユーザーモデルはDjangoデフォルトのモデルと異なり`is_staff`と `is_superuser`の値をDB上に保持しない。代わりにこれらの値は`role`の値から 自動的に決定され、プロパティとして提供される

exception DoesNotExist

ベースクラス: django.core.exceptions.ObjectDoesNotExist

Persona.GENDER_TYPES = (('man', 'Man'), ('woman', 'Woman'), ('unknown', 'Unknown'))
exception Persona.MultipleObjectsReturned

ベースクラス: django.core.exceptions.MultipleObjectsReturned

Persona.ROLE_TYPES = (('adam', 'Adam'), ('seele', 'Seele'), ('nerv', 'Nerv'), ('children', 'Children'), ('wille', 'Wille'))
Persona.actives = <kawaz.core.personas.models.persona.ActivePersonaManager object>
Persona.avatar

Enhanced ImageFileDescriptor

Just like the ImageFileDescriptor, but for ThumbnailField. The only difference is removing previous Image and Thumbnails from storage when the value has changed.

Persona.blog_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 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.

Persona.blog_entries

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.

Persona.clean_fields(exclude=None, **kwargs)[ソース]
Persona.comment_comments

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.

Persona.comment_flags

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.

Persona.commenttestarticle_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.

Persona.created_announcements

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.

Persona.events_attend

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.

Persona.events_owned

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.

Persona.gender

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

Persona.get_absolute_url()[ソース]
Persona.get_avatar(size)[ソース]

渡したサイズのアバターURLを返します 未設定の場合や、見つからない場合はデフォルトアバターを返します

Persona.get_default_avatar(size)[ソース]

デフォルトアバターを返します

Persona.get_gender_display(*moreargs, **morekwargs)
Persona.get_grayscale_avatar()
Persona.get_huge_avatar()
Persona.get_large_avatar()
Persona.get_middle_avatar()
Persona.get_next_by_date_joined(*moreargs, **morekwargs)
Persona.get_previous_by_date_joined(*moreargs, **morekwargs)
Persona.get_role_display(*moreargs, **morekwargs)
Persona.get_small_avatar()
Persona.groups

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.

Persona.id

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

Persona.is_member
Persona.is_staff
Persona.is_superuser
Persona.last_modified_announcements

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.

Persona.last_modified_products

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.

Persona.last_modified_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 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.

Persona.logentry_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.

Persona.material_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.

Persona.nickname

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

Persona.objects = <kawaz.core.personas.models.persona.PersonaManager object>
Persona.product_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.

Persona.projects_joined

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.

Persona.projects_owned

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.

Persona.quotes

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

Persona.registration_profile

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.

Persona.role

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

Persona.save(*args, **kwargs)
Persona.star_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.

Persona.startestarticle_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.

Persona.user_permissions

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 kawaz.core.personas.models.persona.PersonaBase(class_name, bases, namespace)[ソース]

ベースクラス: django.db.models.base.ModelBase

AbstractUser`から継承されたために自動作成される`is_staff`や`is_superuser フィールドを強制的に削除するためのメタクラス

`Persona`モデルは`role`フィールドを持ち、その値により`is_staff`や `is_superuser`の値を決定するためDB上にこれらの値を保持する必要性がない。

class kawaz.core.personas.models.persona.PersonaManager[ソース]

ベースクラス: django.contrib.auth.base_user.BaseUserManager

Persona用カスタムマネージャ

PersonaモデルはDjangoがデフォルトで利用する is_staffis_superuser を DBレベルで廃止しているため、このカスタムが必要

PersonaManagerでは`role`によりユーザーとスーパーユーザを区別しているため create_superuser`で作成されたユーザーは`role`が‘adam’になり、その他の 場合は‘wille’`となる。

create_superuser(username, email, password, **extra_fields)[ソース]
create_user(username, email=None, password=None, **extra_fields)[ソース]
retired()[ソース]
kawaz.core.personas.models.persona.invite_to_slack(user, profile, request, **kwargs)[ソース]

profile Module

class kawaz.core.personas.models.profile.Account(id, profile, service, pub_state, username)[ソース]

ベースクラス: django.db.models.base.Model

exception DoesNotExist

ベースクラス: django.core.exceptions.ObjectDoesNotExist

exception Account.MultipleObjectsReturned

ベースクラス: django.core.exceptions.MultipleObjectsReturned

Account.get_pub_state_display(*moreargs, **morekwargs)
Account.id

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

Account.objects = <django.db.models.manager.Manager object>
Account.profile

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.

Account.profile_id

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

Account.pub_state

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

Account.service

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.

Account.service_id

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

Account.url
Account.username

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

class kawaz.core.personas.models.profile.Profile(*args, **kwargs)[ソース]

ベースクラス: django.db.models.base.Model

It is the model which indicates profiles of each users

exception DoesNotExist

ベースクラス: django.core.exceptions.ObjectDoesNotExist

exception Profile.MultipleObjectsReturned

ベースクラス: django.core.exceptions.MultipleObjectsReturned

Profile.PUB_STATES = (('public', 'Public'), ('protected', 'Internal'))
Profile.accounts

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.

Profile.birthday

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

Profile.created_at

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

Profile.get_absolute_url()[ソース]
Profile.get_next_by_created_at(*moreargs, **morekwargs)
Profile.get_next_by_updated_at(*moreargs, **morekwargs)
Profile.get_previous_by_created_at(*moreargs, **morekwargs)
Profile.get_previous_by_updated_at(*moreargs, **morekwargs)
Profile.get_pub_state_display(*moreargs, **morekwargs)
Profile.objects = <kawaz.core.personas.models.profile.ProfileManager object>
Profile.place

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

Profile.pub_state

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

Profile.remarks

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

Profile.skills

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.

Profile.updated_at

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

Profile.url

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

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

Profile.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 kawaz.core.personas.models.profile.ProfileManager[ソース]

ベースクラス: django.db.models.manager.Manager

active()[ソース]

Returns the QuerySet which contains all active profiles

published(user)[ソース]

Return the QuerySet which contains all active viewable profiles by passed user.

class kawaz.core.personas.models.profile.Service(id, label, icon, url_pattern)[ソース]

ベースクラス: django.db.models.base.Model

exception DoesNotExist

ベースクラス: django.core.exceptions.ObjectDoesNotExist

exception Service.MultipleObjectsReturned

ベースクラス: django.core.exceptions.MultipleObjectsReturned

Service.accounts

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.

Service.active_accounts
Service.get_absolute_url()[ソース]
Service.icon

Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.

Service.id

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

Service.label

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

Service.objects = <django.db.models.manager.Manager object>
Service.url_pattern

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

class kawaz.core.personas.models.profile.Skill(*args, **kwargs)[ソース]

ベースクラス: django.db.models.base.Model

It is the model which indicates what users can

exception DoesNotExist

ベースクラス: django.core.exceptions.ObjectDoesNotExist

exception Skill.MultipleObjectsReturned

ベースクラス: django.core.exceptions.MultipleObjectsReturned

Skill.description

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

Skill.id

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

Skill.label

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

Skill.objects = <django.db.models.manager.Manager object>
Skill.order

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

Skill.users

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.