from django.contrib import admin
from django.utils.html import format_html
# Register your models here.
from .models import Question

class QuestionsAdmin(admin.ModelAdmin):
    """
    Set up question and answer in back end admin page
    """
    list_display=["Question","Answer","dateAsked", "Question_Status"]
    search_fields=["dateAsked","Question","Answer"]
    list_filter=["dateAsked"]

    def Question_Status(self, obj):
        return format_html('<Button><a href="/admin/forum/question/{}/change/">Change Status</a></button> &nbsp', obj.questionID) + format_html('<Button><a href="/admin/forum/question/{}/delete/">Delete</a></button></>', obj.questionID)
    class Meta:
        model=Question

admin.site.register(Question,QuestionsAdmin)

95da2d9fcd3c09c343d7f23886bb2f5f45075f2f
<mask token>


class QuestionsAdmin(admin.ModelAdmin):
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def Question_Status(self, obj):
        return format_html(
            '<Button><a href="/admin/forum/question/{}/change/">Change Status</a></button> &nbsp'
            , obj.questionID) + format_html(
            '<Button><a href="/admin/forum/question/{}/delete/">Delete</a></button></>'
            , obj.questionID)


    class Meta:
        model = Question


<mask token>

<mask token>


class QuestionsAdmin(admin.ModelAdmin):
    """
    Set up question and answer in back end admin page
    """
    list_display = ['Question', 'Answer', 'dateAsked', 'Question_Status']
    search_fields = ['dateAsked', 'Question', 'Answer']
    list_filter = ['dateAsked']

    def Question_Status(self, obj):
        return format_html(
            '<Button><a href="/admin/forum/question/{}/change/">Change Status</a></button> &nbsp'
            , obj.questionID) + format_html(
            '<Button><a href="/admin/forum/question/{}/delete/">Delete</a></button></>'
            , obj.questionID)


    class Meta:
        model = Question


<mask token>

<mask token>


class QuestionsAdmin(admin.ModelAdmin):
    """
    Set up question and answer in back end admin page
    """
    list_display = ['Question', 'Answer', 'dateAsked', 'Question_Status']
    search_fields = ['dateAsked', 'Question', 'Answer']
    list_filter = ['dateAsked']

    def Question_Status(self, obj):
        return format_html(
            '<Button><a href="/admin/forum/question/{}/change/">Change Status</a></button> &nbsp'
            , obj.questionID) + format_html(
            '<Button><a href="/admin/forum/question/{}/delete/">Delete</a></button></>'
            , obj.questionID)


    class Meta:
        model = Question


admin.site.register(Question, QuestionsAdmin)

from django.contrib import admin
from django.utils.html import format_html
from .models import Question


class QuestionsAdmin(admin.ModelAdmin):
    """
    Set up question and answer in back end admin page
    """
    list_display = ['Question', 'Answer', 'dateAsked', 'Question_Status']
    search_fields = ['dateAsked', 'Question', 'Answer']
    list_filter = ['dateAsked']

    def Question_Status(self, obj):
        return format_html(
            '<Button><a href="/admin/forum/question/{}/change/">Change Status</a></button> &nbsp'
            , obj.questionID) + format_html(
            '<Button><a href="/admin/forum/question/{}/delete/">Delete</a></button></>'
            , obj.questionID)


    class Meta:
        model = Question


admin.site.register(Question, QuestionsAdmin)

from django.contrib import admin
from django.utils.html import format_html
# Register your models here.
from .models import Question

class QuestionsAdmin(admin.ModelAdmin):
    """
    Set up question and answer in back end admin page
    """
    list_display=["Question","Answer","dateAsked", "Question_Status"]
    search_fields=["dateAsked","Question","Answer"]
    list_filter=["dateAsked"]

    def Question_Status(self, obj):
        return format_html('<Button><a href="/admin/forum/question/{}/change/">Change Status</a></button> &nbsp', obj.questionID) + format_html('<Button><a href="/admin/forum/question/{}/delete/">Delete</a></button></>', obj.questionID)
    class Meta:
        model=Question

admin.site.register(Question,QuestionsAdmin)
