import error: no module named viewflow.frontend

376 views
Skip to first unread message

angelachakupa.at

unread,
Feb 23, 2017, 6:58:53 AM2/23/17
to Django users
hie guys
m getting this error  Import error: no module named viewflow.frontend  yet i followed the procedures on how to apply the view flow module what could be the problem.


 

Flow.py

 

 

from viewflow import flow,lock

from viewflow.base import this, Flow

from viewflow.contrib import celery

from viewflow.flow.views import CreateProcessView, UpdateProcessView, Startview

from viewflow import frontend

from viewflow.site import viewsite

 

 

from .models import HelloWorldProcess

 

 

@frontend.register

class HelloWorldFlow(Flow):

    process_class = HelloWorldProcess

    lock_impl = lock.select_for_update_lock

 

    start = (

        flow.Start

        (CreateProcessView,

        fields=["text"]

        ).Permission(auto_create=True)\

        .Next(this.approve))

 

    approve = (flow.View(UpdateProcessView,fields=["approved"])\

        .Permission(auto_create=True)\

        .Next(this.check_approve)

    )

 

    check_approve = (

        flow.If(lambda activation: activation.process.approved)\

        .Then(this.send)\

        .Else(this.end)

    )

 

    send = (celery.Job(tasks.send_hello_world_request)\

        .Next(this.end)

    )

 

    end = flow.End()

 

    viewsite.register(HelloWorldFlow)

 

    #def send_question_app_request(self, activation):

        #print(activation.process.text)



this is my flow.py

chris rose

unread,
Feb 23, 2017, 11:03:44 PM2/23/17
to Django users
did you add 'viewflow.frontend' to installed_apps?

Михаил Подгурский

unread,
Feb 24, 2017, 7:52:21 AM2/24/17
to Django users
It looks that you are using an outdated version of the viewflow.

viewflow.frontend was added to the open-source version since 0.12+

Please consider upgrade to the latest 0.12.2

You can check out the viewflow cookbook helloword sample, and get it running with few commands.
 

$ virtualenv env --python=python3.4
$ env/bin/pip install requirements.txt
$ env/bin/python manage.py migrate
$ env/bin/python manage.py createsuperuser
$ env/bin/python manage.py runserver


четверг, 23 февраля 2017 г., 17:58:53 UTC+6 пользователь angelachakupa.at написал:
Reply all
Reply to author
Forward
0 new messages