Admin

evileg_core.admin module

class evileg_core.admin.EActivityBaseAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

autocomplete_fields = ['user']
list_display = ('user', '__str__', 'content_type')
list_filter = ('content_type',)
property media
search_fields = ('user__username',)
class evileg_core.admin.EAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

class Media[source]

Bases: object

css = {'all': ('/static/css/evileg_core.min.css', 'https://cdn.materialdesignicons.com/4.9.95/css/materialdesignicons.min.css', '/static/css/cropper.min.css', 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons', '/static/css/evileg_core_admin.css')}
js = ('//code.jquery.com/jquery.min.js', '/static/js/prettify.js', '/static/js/cropper.min.js', 'https://unpkg.com/popper.js@1.12.6/dist/umd/popper.js', '/static/js/evileg_core.min.js?1', '/static/js/markdown.min.js')
property media
class evileg_core.admin.EArticleAdmin(model, admin_site)[source]

Bases: evileg_core.admin.EPostAdmin

Base class for representation table in Django administration panel. This class is designed for classes which inherits from evileg_core.models.EAbstractArticle

fields = ['user', 'title', 'content_markdown', 'slug', 'pub_date', 'lastmod']
property media
search_fields = ('content', 'user__username', 'title')
class evileg_core.admin.EArticleModeratedAdmin(model, admin_site)[source]

Bases: evileg_core.admin.EModerationMixinAdmin, evileg_core.admin.EArticleAdmin

This class is the EArticleAdmin with moderation opportunity

list_display = ('__str__', 'user', 'pub_date', 'lastmod', 'moderation')
list_filter = (('pub_date', <class 'evileg_core.filters.EDateRangeFilter'>), 'moderation')
property media
class evileg_core.admin.EModerationMixinAdmin(model, admin_site)[source]

Bases: evileg_core.admin.EAdmin

Mixin for representation table in Django administration panel with content which includes moderation opportunity

actions = ['make_spam', 'make_not_moderated', 'make_post_moderated', 'make_moderated']
actions_by_volunteer = ['make_spam_by_volunteer', 'make_moderated_by_volunteer']
list_display = ('moderation',)
list_filter = ('moderation',)
make_moderated(request, queryset)[source]

Action for marking content like MODERATED

Parameters
  • request – HTTP request

  • queryset – queryset of model objects

make_moderated_by_volunteer(request, queryset)[source]

Action for marking content like MODERATED by volunteer opinion

Parameters
  • request – HTTP request

  • queryset – queryset of model objects

make_not_moderated(request, queryset)[source]

Action for marking content like NOT MODERATED

Parameters
  • request – HTTP request

  • queryset – queryset of model objects

make_post_moderated(request, queryset)[source]

Action for marking content like POST MODERATED

Parameters
  • request – HTTP request

  • queryset – queryset of model objects

make_spam(request, queryset)[source]

Action for marking content like SPAM

Parameters
  • request – HTTP request

  • queryset – queryset of model objects

make_spam_by_volunteer(request, queryset)[source]

Action for marking content like SPAM by volunteer opinion

Parameters
  • request – HTTP request

  • queryset – queryset of model objects

property media
moderate(request, rows_updated, choice_description)[source]

Common method for representation of marking result

Parameters
  • request – HTTP request

  • rows_updated – count of updated ibjects

  • choice_description – SPAM, NOT MODERATED, POST MODERATED or MODERATED

class evileg_core.admin.EPostAdmin(model, admin_site)[source]

Bases: evileg_core.admin.EAdmin

Base class for representation table in Django administration panel. This class is designed for classes which inherits from evileg_core.models.EAbstractPost

autocomplete_fields = ['user']
fields = ['user', 'content_markdown', 'pub_date', 'lastmod']
list_display = ('__str__', 'user', 'pub_date', 'lastmod')
list_filter = (('pub_date', <class 'evileg_core.filters.EDateRangeFilter'>),)
property media
readonly_fields = ('pub_date', 'lastmod')
search_fields = ('content', 'user__username')
class evileg_core.admin.EPostModeratedAdmin(model, admin_site)[source]

Bases: evileg_core.admin.EModerationMixinAdmin, evileg_core.admin.EPostAdmin

This class is the EPostAdmin with moderation opportunity

list_display = ('__str__', 'user', 'pub_date', 'lastmod', 'moderation')
list_filter = (('pub_date', <class 'evileg_core.filters.EDateRangeFilter'>), 'moderation')
property media
class evileg_core.admin.ESectionAdmin(model, admin_site)[source]

Bases: evileg_core.admin.EArticleAdmin

Base class for representation table in Django administration panel. This class is designed for classes which inherits from evileg_core.models.EAbstractSection

list_display = ('__str__', 'user', 'pub_date', 'lastmod')
list_filter = (('pub_date', <class 'evileg_core.filters.EDateRangeFilter'>),)
property media
class evileg_core.admin.ESectionModeratedAdmin(model, admin_site)[source]

Bases: evileg_core.admin.EModerationMixinAdmin, evileg_core.admin.ESectionAdmin

This class is the ESectionAdmin with moderation opportunity

list_display = ('__str__', 'user', 'pub_date', 'lastmod', 'moderation')
list_filter = (('pub_date', <class 'evileg_core.filters.EDateRangeFilter'>), 'moderation')
property media

Examples

Using of EPostModeratedAdmin for Post Model, which inherits from EAbstractModeratedPost.

from django.contrib import admin
from evileg_core.admin import EPostModeratedAdmin

from your_app.models import Post

admin.site.register(Post, EPostModeratedAdmin)