How to use the crash.admin.BooleanFilter function in crash

To help you get started, we’ve selected a few crash examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Crystalnix / omaha-server / omaha_server / feedback / admin.py View on Github external
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
"""

from django.contrib import admin

from crash.admin import TextInputFilter, BooleanFilter

from feedback.models import Feedback, FeedbackDescription
from feedback.forms import FeedbackForm


class ScreenshotFilter(BooleanFilter):
    title = 'Screenshot'
    parameter_name = 'screenshot'


class BlackboxFilter(BooleanFilter):
    title = 'Blackbox'
    parameter_name = 'blackbox'


class SystemLogsFilter(BooleanFilter):
    title = 'System Logs'
    parameter_name = 'system_logs'


class AttachedFileFilter(BooleanFilter):
    title = 'Attached File'
github Crystalnix / omaha-server / omaha_server / feedback / admin.py View on Github external
class ScreenshotFilter(BooleanFilter):
    title = 'Screenshot'
    parameter_name = 'screenshot'


class BlackboxFilter(BooleanFilter):
    title = 'Blackbox'
    parameter_name = 'blackbox'


class SystemLogsFilter(BooleanFilter):
    title = 'System Logs'
    parameter_name = 'system_logs'


class AttachedFileFilter(BooleanFilter):
    title = 'Attached File'
    parameter_name = 'attached_file'


def short_url(obj):
    limit = 60
    res = obj.page_url
    return res if len(res) < limit else res[:limit] + '...'
short_url.short_description = 'Page URL'

@admin.register(Feedback)
class FeedbackAdmin(admin.ModelAdmin):
    list_display = ('id', 'description', 'email', short_url, 'created_at', 'ip',)
    list_display_links = ('id', 'description')
    list_filter = (('id', TextInputFilter,), ScreenshotFilter, BlackboxFilter, SystemLogsFilter, AttachedFileFilter, 'created_at',)
    form = FeedbackForm
github Crystalnix / omaha-server / omaha_server / feedback / admin.py View on Github external
from feedback.models import Feedback, FeedbackDescription
from feedback.forms import FeedbackForm


class ScreenshotFilter(BooleanFilter):
    title = 'Screenshot'
    parameter_name = 'screenshot'


class BlackboxFilter(BooleanFilter):
    title = 'Blackbox'
    parameter_name = 'blackbox'


class SystemLogsFilter(BooleanFilter):
    title = 'System Logs'
    parameter_name = 'system_logs'


class AttachedFileFilter(BooleanFilter):
    title = 'Attached File'
    parameter_name = 'attached_file'


def short_url(obj):
    limit = 60
    res = obj.page_url
    return res if len(res) < limit else res[:limit] + '...'
short_url.short_description = 'Page URL'

@admin.register(Feedback)
github Crystalnix / omaha-server / omaha_server / feedback / admin.py View on Github external
"""

from django.contrib import admin

from crash.admin import TextInputFilter, BooleanFilter

from feedback.models import Feedback, FeedbackDescription
from feedback.forms import FeedbackForm


class ScreenshotFilter(BooleanFilter):
    title = 'Screenshot'
    parameter_name = 'screenshot'


class BlackboxFilter(BooleanFilter):
    title = 'Blackbox'
    parameter_name = 'blackbox'


class SystemLogsFilter(BooleanFilter):
    title = 'System Logs'
    parameter_name = 'system_logs'


class AttachedFileFilter(BooleanFilter):
    title = 'Attached File'
    parameter_name = 'attached_file'


def short_url(obj):
    limit = 60