Update local manager app to user icons and app registry
This commit is contained in:
@@ -30,6 +30,7 @@ DICTIONARY = {
|
|||||||
KEY_DELETE: 'key_delete.png',
|
KEY_DELETE: 'key_delete.png',
|
||||||
KEYBOARD: 'keyboard.png',
|
KEYBOARD: 'keyboard.png',
|
||||||
LIGHTNING: 'lightning.png',
|
LIGHTNING: 'lightning.png',
|
||||||
|
LOCK: 'lock.png',
|
||||||
MEDAL_GOLD: 'medal_gold_1.png',
|
MEDAL_GOLD: 'medal_gold_1.png',
|
||||||
MEDAL_GOLD_ADD: 'medal_gold_add.png',
|
MEDAL_GOLD_ADD: 'medal_gold_add.png',
|
||||||
MEDAL_GOLD_DELETE: 'medal_gold_delete.png',
|
MEDAL_GOLD_DELETE: 'medal_gold_delete.png',
|
||||||
|
|||||||
7
apps/lock_manager/icons.py
Normal file
7
apps/lock_manager/icons.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from icons.literals import LOCK
|
||||||
|
from icons import Icon
|
||||||
|
|
||||||
|
icon_lock = Icon(LOCK)
|
||||||
|
|
||||||
1
apps/lock_manager/literals.py
Normal file
1
apps/lock_manager/literals.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
DEFAULT_LOCK_TIMEOUT_VALUE = 30
|
||||||
@@ -7,8 +7,8 @@ from django.db import (models, transaction, DatabaseError)
|
|||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from .managers import LockManager
|
from .managers import LockManager
|
||||||
from .conf.settings import DEFAULT_LOCK_TIMEOUT
|
#from .settings import DEFAULT_LOCK_TIMEOUT
|
||||||
|
DEFAULT_LOCK_TIMEOUT = 60
|
||||||
|
|
||||||
class Lock(models.Model):
|
class Lock(models.Model):
|
||||||
creation_datetime = models.DateTimeField(verbose_name=_(u'creation datetime'))
|
creation_datetime = models.DateTimeField(verbose_name=_(u'creation datetime'))
|
||||||
|
|||||||
22
apps/lock_manager/registry.py
Normal file
22
apps/lock_manager/registry.py
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
from smart_settings import LocalScope
|
||||||
|
|
||||||
|
from .literals import DEFAULT_LOCK_TIMEOUT_VALUE
|
||||||
|
from .icons import icon_lock
|
||||||
|
|
||||||
|
name = 'lock_manager'
|
||||||
|
label = _(u'Lock manager')
|
||||||
|
description = _(u'Handles resource locking.')
|
||||||
|
icon = icon_lock
|
||||||
|
dependencies = ['app_registry', 'icons', 'smart_settings']
|
||||||
|
settings = [
|
||||||
|
{
|
||||||
|
'name': 'DEFAULT_LOCK_TIMEOUT',
|
||||||
|
'default': DEFAULT_LOCK_TIMEOUT_VALUE,
|
||||||
|
'description': _(u'Default amount of time in seconds after which a lock will be automatically released.'),
|
||||||
|
'scopes': [LocalScope()]
|
||||||
|
}
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user