events Package

activity Module

class kawaz.apps.events.activity.EventActivityMediator[ソース]

ベースクラス: activities.mediator.ActivityMediator

alter(instance, activity, **kwargs)[ソース]
m2m_fields = ('attendees',)
prepare_context(activity, context, typename=None)[ソース]

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
number_of_attendees(obj)[ソース]
organizer_name(obj)[ソース]
save_model(request, obj, form, change)[ソース]
search_fields = ('title', 'body', 'organizer__username', 'organizer__nickname', 'category__label', 'place')
class kawaz.apps.events.admin.EventCategoryAdmin(model, admin_site)[ソース]

ベースクラス: django.contrib.admin.options.ModelAdmin

list_display = ('label', 'number_of_events')
media
number_of_events(obj)[ソース]

filters Module

forms Module

gcal Module

Google Calendar 連携用 Backend kawaz.core.google.calendar に依存し settings.GOOGLE_CALENDAR_BACKEND で指定 されている

class kawaz.apps.events.gcal.KawazGoogleCalendarBackend[ソース]

ベースクラス: google_calendar.backend.Backend

is_valid(event, raise_exception=False)[ソース]

Kawaz3のEventモデルインスタンスが、Google Calendar API Version3の Bodyパラメーターと適合しているかをチェックします

translate(event)[ソース]

Kawaz3のEventモデルをGoogle Calendar API Version3のBodyパラメーターに変換します

Params:
event [Event] Eventモデルインスタンス
戻り値:[dict] パラメーター
kawaz.apps.events.gcal.get_base_url()[ソース]

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

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.

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.attend(user)[ソース]

指定されたユーザーをこのイベントに参加させる

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

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 a ForwardManyToOneDescriptor 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. 開始時間が指定されているが終了時間が指定されていないイベントは

作成できない(一生イベントに参加とかは物理的に不可能)
  1. 参加者制限が0人のイベントは作成できない
  2. 参加締め切りは未来でなければいけない
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_absolute_url()[ソース]
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 a ReverseOneToOneDescriptor 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.is_active()[ソース]

イベントが終了していないか否か

Event.is_attendee(user)[ソース]

参加者か否か

Event.is_over_deadline()[ソース]

参加締め切りを超えているか否か

Event.is_over_restriction()[ソース]

人数制限を超えているか否か

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 a ForwardManyToOneDescriptor 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.quit(user)[ソース]

指定されたユーザーをこのイベントから退会させる

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.

class kawaz.apps.events.models.EventManager[ソース]

ベースクラス: django.db.models.manager.Manager, kawaz.core.publishments.models.PublishmentManagerMixin

active(user)[ソース]

指定されたユーザーに公開されたイベントの中で、まだ終わっていない or イベントの終了時期が指定されていないかつ、作成日から30日日以内のイベントを含むクエリを返す

attendable(user)[ソース]

指定されたユーザーに公開されたイベントの中で、参加可能なイベントを 含むクエリを返す

author_field_name = 'organizer'
kawaz.apps.events.models.join_organizer(**kwargs)[ソース]

作成者を自動的に参加させるシグナルレシーバ

perms Module

class kawaz.apps.events.perms.EventPermissionLogic[ソース]

ベースクラス: permission.logics.base.PermissionLogic

Permission logic of Event model which for

  • events.add_event
  • events.change_event
  • events.delete_event
  • events.attend_event
  • events.quit_event
has_perm(user_obj, perm, obj=None)[ソース]

Check if user have a specified event permissions (of obj)

urls Module

views Module