models Package¶
models
Package¶
persona
Module¶
-
class
kawaz.core.personas.models.persona.
ActivePersonaManager
[ソース]¶ ベースクラス:
kawaz.core.personas.models.persona.PersonaManager
アクティブユーザーのみを取り出すManager
-
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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_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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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
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.
-
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 aReverseManyToOneDescriptor
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_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
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.
-
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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
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.
-
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
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.
-
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 aReverseManyToOneDescriptor
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 aReverseOneToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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
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.
-
exception
-
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_staff や is_superuser を DBレベルで廃止しているため、このカスタムが必要
PersonaManagerでは`role`によりユーザーとスーパーユーザを区別しているため create_superuser`で作成されたユーザーは`role`が‘adam’になり、その他の 場合は‘wille’`となる。
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 aForwardManyToOneDescriptor
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 aForwardManyToOneDescriptor
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.
-
exception
-
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 aReverseManyToOneDescriptor
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_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
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.
-
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 aForwardOneToOneDescriptor
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.
-
exception
-
class
kawaz.core.personas.models.profile.
ProfileManager
[ソース]¶ ベースクラス:
django.db.models.manager.Manager
-
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 aReverseManyToOneDescriptor
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.
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.
-
exception
-
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
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.
-
exception