events Package¶
activity
Module¶
admin
Module¶
-
class
kawaz.apps.events.admin.
EventAdmin
(model, admin_site)[ソース]¶ ベースクラス:
django.contrib.admin.options.ModelAdmin
-
list_display
= ('title', 'organizer_name', 'get_pub_state_display', 'period_start', 'number_of_attendees', 'created_at', 'updated_at')¶
-
media
¶
-
search_fields
= ('title', 'body', 'organizer__username', 'organizer__nickname', 'category__label', 'place')¶
-
filters
Module¶
forms
Module¶
gcal
Module¶
Google Calendar 連携用 Backend kawaz.core.google.calendar に依存し settings.GOOGLE_CALENDAR_BACKEND で指定 されている
models
Module¶
-
class
kawaz.apps.events.models.
Category
(*args, **kwargs)[ソース]¶ ベースクラス:
django.db.models.base.Model
イベントの大カテゴリ 運営が設置したものをユーザーが選ぶ
-
exception
DoesNotExist
¶ ベースクラス:
django.core.exceptions.ObjectDoesNotExist
-
exception
Category.
MultipleObjectsReturned
¶ ベースクラス:
django.core.exceptions.MultipleObjectsReturned
-
Category.
events
¶ 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.
-
Category.
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
Category.
label
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
Category.
objects
= <django.db.models.manager.Manager object>¶
-
Category.
order
¶ 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.apps.events.models.
Event
(id, pub_state, title, body, period_start, period_end, place, number_restriction, attendance_deadline, organizer, category, created_at, updated_at)[ソース]¶ ベースクラス:
django.db.models.base.Model
-
exception
DoesNotExist
¶ ベースクラス:
django.core.exceptions.ObjectDoesNotExist
-
exception
Event.
MultipleObjectsReturned
¶ ベースクラス:
django.core.exceptions.MultipleObjectsReturned
-
Event.
active_attendees
¶
-
Event.
attendance_deadline
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
Event.
attendees
¶ 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.
-
Event.
body
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
Event.
category
¶ 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.
-
Event.
category_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
Event.
clean
()[ソース]¶ 下記のルールに従ってValidationする 1. イベント終了時間は開始時間より遅い必要がある(時間は逆行できない) 2. 過去のイベントは作成できない(スネーク!タイムパラドックスだ!) 3. 7日以上にまたがるイベントは作成できない 4. 開始時間が指定されているが終了時間が指定されていないイベントは
作成できない(一生イベントに参加とかは物理的に不可能)- 参加者制限が0人のイベントは作成できない
- 参加締め切りは未来でなければいけない
-
Event.
created_at
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
Event.
get_next_by_created_at
(*moreargs, **morekwargs)¶
-
Event.
get_next_by_updated_at
(*moreargs, **morekwargs)¶
-
Event.
get_previous_by_created_at
(*moreargs, **morekwargs)¶
-
Event.
get_previous_by_updated_at
(*moreargs, **morekwargs)¶
-
Event.
get_pub_state_display
(*moreargs, **morekwargs)¶
-
Event.
googlecalendarbridge
¶ 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.
-
Event.
humanized_period
¶ 開催日時をいい感じで描画します
- Output:
- 5月10日(月) 13:00 ~ 19:00 2013年9月21(土) 13:00 ~ 19:00 6月11日(月) 13:00 ~ 6月12日(火) 10:00 未定 6月11日(月) 13:00 ~ 終了日時未定
-
Event.
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
Event.
number_restriction
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
Event.
objects
= <kawaz.apps.events.models.EventManager object>¶
-
Event.
organizer
¶ 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.
-
Event.
organizer_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
Event.
period_end
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
Event.
period_start
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
Event.
place
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
Event.
pub_state
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
Event.
save
(force_insert=False, force_update=False, using=None, update_fields=None)¶ Saves the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
-
Event.
title
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
Event.
updated_at
¶ 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.apps.events.models.
EventManager
[ソース]¶ ベースクラス:
django.db.models.manager.Manager
,kawaz.core.publishments.models.PublishmentManagerMixin
-
active
(user)[ソース]¶ 指定されたユーザーに公開されたイベントの中で、まだ終わっていない or イベントの終了時期が指定されていないかつ、作成日から30日日以内のイベントを含むクエリを返す
-