evennia.web.website.views.channels

Views for managing channels.

class evennia.web.website.views.channels.ChannelMixin[source]

Bases: 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

alias of evennia.comms.comms.DefaultChannel

page_title = 'Channels'
access_type = 'listen'
get_queryset()[source]

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

Returns

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

class evennia.web.website.views.channels.ChannelListView(**kwargs)[source]

Bases: 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)[source]

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

Returns

context (dict) – Django context object

class evennia.web.website.views.channels.ChannelDetailView(**kwargs)[source]

Bases: 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)[source]

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

Returns

context (dict) – Django context object

get_object(queryset=None)[source]

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

Returns

channel (Channel) – Channel requested in the URL.