Import and PEP8 cleanups
This commit is contained in:
@@ -3,7 +3,7 @@ from __future__ import absolute_import
|
||||
import logging
|
||||
import datetime
|
||||
|
||||
from django.db import models, IntegrityError
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.contenttypes import generic
|
||||
@@ -11,7 +11,6 @@ from django.contrib.contenttypes import generic
|
||||
from documents.models import Document
|
||||
|
||||
from .managers import DocumentCheckoutManager
|
||||
from .exceptions import DocumentAlreadyCheckedOut
|
||||
from .events import history_document_checked_out
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -33,9 +32,9 @@ class DocumentCheckout(models.Model):
|
||||
#block_metadata
|
||||
#block_editing
|
||||
#block tag add/remove
|
||||
|
||||
|
||||
objects = DocumentCheckoutManager()
|
||||
|
||||
|
||||
def __unicode__(self):
|
||||
return unicode(self.document)
|
||||
|
||||
@@ -45,11 +44,11 @@ class DocumentCheckout(models.Model):
|
||||
result = super(DocumentCheckout, self).save(*args, **kwargs)
|
||||
history_document_checked_out.commit(source_object=self.document, data={'user': self.user_object, 'document': self.document})
|
||||
return result
|
||||
|
||||
|
||||
@models.permalink
|
||||
def get_absolute_url(self):
|
||||
return ('checkout_info', [self.document.pk])
|
||||
|
||||
return ('checkout_info', [self.document.pk])
|
||||
|
||||
class Meta:
|
||||
verbose_name = _(u'document checkout')
|
||||
verbose_name_plural = _(u'document checkouts')
|
||||
|
||||
Reference in New Issue
Block a user