evennia.web.website.views.channels

Views for managing channels.

class evennia.web.website.views.channels.ChannelMixin[源代码]

基类:evennia.web.website.views.mixins.TypeclassMixin

This is a “mixin”, a modifier of sorts.

Any view class with this in its inheritance list will be modified to work with HelpEntry objects instead of generic Objects or otherwise.

model

evennia.comms.comms.DefaultChannel 的别名

page_title = 'Channels'
access_type = 'listen'
get_queryset()[源代码]

Django hook; here we want to return a list of only those Channels and other documentation that the current user is allowed to see.

返回

queryset (QuerySet) – List of Channels available to the user.

class evennia.web.website.views.channels.ChannelListView(**kwargs)[源代码]

基类:evennia.web.website.views.channels.ChannelMixin, django.views.generic.list.ListView

Returns a list of channels that can be viewed by a user, authenticated or not.

paginate_by = 100
template_name = 'website/channel_list.html'
page_title = 'Channel Index'
get_context_data(**kwargs)[源代码]

Django hook; we override it to calculate the most popular channels.

返回

context (dict) – Django context object

class evennia.web.website.views.channels.ChannelDetailView(**kwargs)[源代码]

基类:evennia.web.website.views.channels.ChannelMixin, evennia.web.website.views.objects.ObjectDetailView

Returns the log entries for a given channel.

template_name = 'website/channel_detail.html'
attributes = ['name']
max_num_lines = 10000
get_context_data(**kwargs)[源代码]

Django hook; before we can display the channel logs, we need to recall the logfile and read its lines.

返回

context (dict) – Django context object

get_object(queryset=None)[源代码]

Override of Django hook that retrieves an object by slugified channel name.

返回

channel (Channel) – Channel requested in the URL.