Commits

Artur Barseghyan committed 8aac113 Draft

more on python 3 support

Comments (0)

Files changed (14)

example/requirements.txt

 Django==1.5.2
 Pillow==2.1.0
 django-autoslug==1.6.1
-#django-lime==0.2
--e hg+https://bitbucket.org/barseghyanartur/django-lime#egg=django-lime
+django-lime==0.3
 django-reversion==1.7.1
 django-tinymce==1.5.1
 python-dateutil==2.1
 pytz==2013b
 six==1.4.1
 South==0.8.2
-#django-werewolf
-
-# Werewolf old dependences
-# 0.1
-#django-reversion==1.6.5
+django-werewolf==0.2
     license = 'GPL 2.0/LGPL 2.1',
     install_requires = [
         'six==1.4.1',
-        #'django-reversion==1.6.5'
         'django-reversion==1.7.1'
     ]
 )

src/werewolf/__init__.py

+__title__ = 'werewolf.views'
+__version__ = '0.2'
+__build__ = 0x000002
+__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
+__all__ = ('autodiscover',)
+
 import imp
 
 from django.conf import settings

src/werewolf/admin.py

+__title__ = 'werewolf.admin'
+__version__ = '0.2'
+__build__ = 0x000002
+__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
 __all__ = ('WerewolfBaseAdmin',)
 
 from django.contrib import admin
 from werewolf.settings import USE_DJANGO_REVERSION, DEFAULT_STATUS
 
 if USE_DJANGO_REVERSION:
-    import reversion
     from reversion.admin import VersionAdmin
     AdminParentClass = VersionAdmin
-    #create_on_success = reversion.revision.create_on_success
 else:
     AdminParentClass = admin.ModelAdmin
-    #def create_on_success(func):
-    #    """
-    #    A do-nothing replacement if we're not using django-reversion.
-    #    """
-    #    return func
-
 
 class WerewolfBaseAdmin(AdminParentClass):
     """

src/werewolf/conf.py

+__title__ = 'werewolf.conf'
+__version__ = '0.2'
+__build__ = 0x000002
+__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
+__all__ = ('get_setting',)
+
 from django.conf import settings
 
 from werewolf import defaults

src/werewolf/constants.py

+__title__ = 'werewolf.constants'
+__version__ = '0.2'
+__build__ = 0x000002
+__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
+__all__ = ('CHANGE_STATUS_TO', 'CAN_VIEW_STATUS')
+
 # Don't touch this!
 CHANGE_STATUS_TO = 'change_status_to'
 CAN_VIEW_STATUS = 'can_view_status'

src/werewolf/defaults.py

+__title__ = 'werewolf.defaults'
+__version__ = '0.2'
+__build__ = 0x000002
+__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
+__all__ = ('STATUS_CHOICES', 'STATUS_PUBLISHED', 'DEFAULT_STATUS', 'STATUS_MAX_LENGTH', 'USE_DJANGO_REVERSION')
+
 gettext = lambda s: s
 
 # Status choices for the workflow. When customizing pay extra attention to `STATUS_PUBLISHED` and `DEFAULT_STATUS`

src/werewolf/helpers.py

+__title__ = 'werewolf.helpers'
+__version__ = '0.2'
+__build__ = 0x000002
+__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
 __all__ = ('admin_edit_url', 'admin_edit_url_for_object')
 
 from django.core.urlresolvers import reverse

src/werewolf/management/commands/syncww.py

+__title__ = 'werewolf.management.commands.syncww'
+__version__ = '0.2'
+__build__ = 0x000002
+__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
+__all__ = ('Command',)
+
 from django.core.management.base import BaseCommand
 from django.db.models import get_models, get_app
 from django.contrib.auth.management import create_permissions

src/werewolf/models/__init__.py

+__title__ = 'werewolf.models.__init__'
+__version__ = '0.2'
+__build__ = 0x000002
+__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
 __all__ = ('WerewolfBaseMeta', 'WerewolfBaseModel')
 
 from django.db import models
 DEFAULT_STATUS = get_setting('DEFAULT_STATUS')
 STATUS_MAX_LENGTH = get_setting('STATUS_MAX_LENGTH')
 
-
 class WerewolfBaseMeta(object):
     """
-    Base Meta class of the ``WerewolfBaseModel``. Every subclass of the ``WerewolfBaseModel`` shall extend it:
+    Base Meta class of the ``WerewolfBaseModel``. Every subclass of the ``WerewolfBaseModel``
+    shall extend it:
     
     >>> from werewolf.models import WerewolfBaseModel, WerewolfBaseMeta
     >>> class NewsItem(WerewolfBaseModel): # Important!
 
 class WerewolfBaseModel(models.Model):
     """
-    Base Werewolf model. If you want to have a workflow in your model (for statuses like new, draft, published, etc)
-    you should extend this model.
+    Base Werewolf model. If you want to have a workflow in your model (for statuses like new, draft, 
+    published, etc) you should extend this model.
     """
-    status = models.CharField(_("Status"), max_length=STATUS_MAX_LENGTH, choices=STATUS_CHOICES, default=DEFAULT_STATUS)
+    status = models.CharField(_("Status"), max_length=STATUS_MAX_LENGTH, choices=STATUS_CHOICES, \
+                              default=DEFAULT_STATUS)
 
     objects = WerewolfBaseManager()
 

src/werewolf/models/managers.py

+__title__ = 'werewolf.models.managers'
+__version__ = '0.2'
+__build__ = 0x000002
+__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
 __all__ = ('WerewolfBaseManager',)
 
 from django.db import models
 
 from werewolf.settings import STATUS_PUBLISHED
 
-
 class WerewolfBaseManager(models.Manager):
     """
     Werewolf base manager.

src/werewolf/settings.py

+__title__ = 'werewolf.settings'
+__version__ = '0.2'
+__build__ = 0x000002
+__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
 __all__ = ('STATUS_CHOICES', 'STATUS_PUBLISHED', 'DEFAULT_STATUS', 'STATUS_MAX_LENGTH', 'USE_DJANGO_REVERSION')
 
 from werewolf.conf import get_setting

src/werewolf/triggers.py

+__title__ = 'werewolf.triggers'
+__version__ = '0.2'
+__build__ = 0x000002
+__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
 __all__ = ('WerewolfBaseTrigger', 'registry')
 
 class WerewolfBaseTrigger(object):
     def process(self):
         raise NotImplementedError("You should define a ``process`` method in your trigger class!")
 
+
 class WerewolfRegistry(object):
     """
     Trigger registry.
     def get_for_model(self, model, status):
         return self.get(model._meta.app_label, model._meta.module_name, status)
 
+
 # Register triggers by calling registry.register()
 registry = WerewolfRegistry()

src/werewolf/utils.py

+__title__ = 'werewolf.utils'
+__version__ = '0.2'
+__build__ = 0x000002
+__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
 __all__ = ('permission_key', 'permissions_for_base_model', 'status_choices_for_user', \
            'extend_werewolf_permissions')