Skip to content

Commit

Permalink
django version 1.7 and 1.8 are supported. Doc is updated with require…
Browse files Browse the repository at this point in the history
…ments and supported python and django versions
  • Loading branch information
javrasya committed Aug 31, 2015
1 parent 0267c46 commit 225c691
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 203 deletions.
9 changes: 9 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ Documentation

Online documentation is available at http://django-river.rtfd.org/.

Requirements
------------
* Python (2.7, 3.2, 3.3, 3.4)
* Pypy (2,3)
* Django (1.7, 1.8)

PyPy (1.8, 1.9)
Jython (2.5, 2.7).

Installation
------------

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
# built documents.
#
# The short X.Y version.
version = '0.4.0'
version = '0.4.1'
# The full version, including alpha/beta/rc tags.
release = '0.4.0'
release = '0.4.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
8 changes: 7 additions & 1 deletion docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@ Overview
========
Main goal of developing this framework is **to be able to edit any workflow item on the fly.** This means, all elements in workflow like states, transitions, user authorizations(permission), group authorization are editable. To do this, all data about the workflow item is persisted into DB. **Hence, they can be changed without touching the code and re-deploying your application.**

There is ordering aprovments for a transition functionality in ``django-river``. It also provides skipping specific transition of a specific objects.
There is ordering aprovments for a transition functionality in ``django-river``. It also provides skipping specific transition of a specific objects.

Requirements
------------
* Python (``2.7``, ``3.2``, ``3.3``, ``3.4``)
* Pypy (``2``, ``3``)
* Django (``1.7``, ``1.8``)
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
django
django-mptt
factory-boy
mock
128 changes: 0 additions & 128 deletions river/migrations/0001_initial.py

This file was deleted.

28 changes: 0 additions & 28 deletions river/migrations/0002_handler.py

This file was deleted.

Empty file removed river/migrations/__init__.py
Empty file.
5 changes: 4 additions & 1 deletion river/models/approvement.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from django.contrib.contenttypes.fields import GenericForeignKey
try:
from django.contrib.contenttypes.fields import GenericForeignKey
except ImportError:
from django.contrib.contenttypes.generic import GenericForeignKey

from django.db import models

Expand Down
15 changes: 7 additions & 8 deletions river/models/fields/state.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from django.contrib.contenttypes.fields import GenericRelation
from django.contrib.contenttypes.models import ContentType

from django.db.models.signals import pre_save

from django.db.models.signals import post_save

try:
from django.contrib.contenttypes.fields import GenericRelation
except ImportError:
from django.contrib.contenttypes.generic import GenericRelation

from river.models import State, Approvement
from river.models.approvement_track import ApprovementTrack
from river.models.managers.wofkflow_object import WorkflowObjectManager
from river.services.config import RiverConfig
from river.services.object import ObjectService
from river.services.transition import TransitionService

Expand All @@ -18,10 +18,9 @@


class StateField(models.ForeignKey):
def __init__(self, state_model=State, reverse_identifier=None, object_manager=WorkflowObjectManager, *args, **kwargs):
def __init__(self, state_model=State, object_manager=WorkflowObjectManager, *args, **kwargs):
kwargs['null'] = True
kwargs['blank'] = True
self.reverse_identifier = reverse_identifier
self.object_manager = object_manager
kwargs['to'] = '%s.%s' % (state_model._meta.app_label, state_model._meta.object_name)
super(StateField, self).__init__(*args, **kwargs)
Expand Down Expand Up @@ -78,7 +77,7 @@ def next_approvements(self):

self.model = cls

self.__add_to_class(cls, "approvements", GenericRelation('%s.%s' % (Approvement._meta.app_label, Approvement._meta.object_name), related_query_name=self.reverse_identifier))
self.__add_to_class(cls, "approvements", GenericRelation('%s.%s' % (Approvement._meta.app_label, Approvement._meta.object_name)))
self.__add_to_class(cls, "approvement_track", models.ForeignKey('%s.%s' % (ApprovementTrack._meta.app_label, ApprovementTrack._meta.object_name), null=True, blank=True))

self.__add_to_class(cls, "objects", self.object_manager(name))
Expand Down
3 changes: 2 additions & 1 deletion river/tests/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__author__ = 'ahmetdal'

from river.tests.models.testmodel import *
# from river.tests.models.testmodel import *
from .testmodel import *
2 changes: 1 addition & 1 deletion river/tests/models/testmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

class TestModel(models.Model):
test_field = models.CharField(max_length=50, null=True, blank=True)
my_field = StateField(related_query_name='test_model')
my_field = StateField()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

setup(
name='django-river',
version='0.4.0',
version='0.4.1',
author='Ahmet DAL',
author_email='ceahmetdal@gmail.com',
packages=find_packages(),
Expand Down
42 changes: 11 additions & 31 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,48 +1,28 @@
[tox]
envlist =
2.7,
3.3,
3.4,
pypy,
pypy3,
envlist ={py2.7,py3.3,py3.4,pypy,pypy3}-{dj1.7,dj1.8},
cov

[testenv]
basepython = python2.7
sitepackages = False
basepython =
py2.7: python2.7
py3.3: python3.3
py3.4: python3.4
pypy: pypy
pypy3: pypy3
deps =
pytest-django
pytest-cov
-rrequirements.txt
dj1.7: Django>=1.7,<1.8
dj1.8: Django>=1.8,<1.9
commands = py.test --ds='test_settings' --junitxml=../junit-{envname}.xml

[testenv:2.7]
basepython = python2.7

[testenv:3.3]
basepython = python3.3

[testenv:3.4]
basepython = python3.4

[testenv:pypy]
basepython = pypy

[testenv:pypy3]
basepython = pypy3

[testenv:docs]
deps =
sphinx
-rrequirements.txt
commands =
sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs docs/_build/linkcheck


[testenv:cov]
basepython = python2.7
deps =
pytest-django
pytest-cov
django
-rrequirements.txt
commands =
py.test --ds='test_settings' --cov ./ --cov-report term-missing
Expand Down

0 comments on commit 225c691

Please sign in to comment.