File: models.py

package info (click to toggle)
django-rq 3.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 620 kB
  • sloc: python: 2,964; makefile: 8
file content (19 lines) | stat: -rw-r--r-- 667 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from django.core.signals import got_request_exception, request_finished
from django.db import models

from . import thread_queue
from .queues import get_commit_mode

# If we're not in AUTOCOMMIT mode, wire up request finished/exception signal
if not get_commit_mode():
    request_finished.connect(thread_queue.commit)
    got_request_exception.connect(thread_queue.clear)


class Queue(models.Model):
    """Placeholder model with no database table, but with django admin page
    and contenttype permission"""
    class Meta:
        managed = False  # not in Django's database
        default_permissions = ()
        permissions = [['view', 'Access admin page']]