django-viewflow

ViewFlow and django-guardian

蓝咒 提交于 2021-02-08 08:11:41
问题 I want to make use of django-guardian 's object permissions and grant specific rights for specific users to one or more Django users. I have tried to add some permissions to my Process class like this: class TestProcess(Process): title = models.CharField(max_length=64) something = models.ForeignKey(ForInheritage, null=True, on_delete=models.CASCADE) no_approval = models.BooleanField(default=False) approved = models.BooleanField(default=False) def something_is_approved(self): try: return self

ViewFlow and django-guardian

醉酒当歌 提交于 2021-02-08 08:10:50
问题 I want to make use of django-guardian 's object permissions and grant specific rights for specific users to one or more Django users. I have tried to add some permissions to my Process class like this: class TestProcess(Process): title = models.CharField(max_length=64) something = models.ForeignKey(ForInheritage, null=True, on_delete=models.CASCADE) no_approval = models.BooleanField(default=False) approved = models.BooleanField(default=False) def something_is_approved(self): try: return self

ViewFlow and django-guardian

℡╲_俬逩灬. 提交于 2021-02-08 08:10:23
问题 I want to make use of django-guardian 's object permissions and grant specific rights for specific users to one or more Django users. I have tried to add some permissions to my Process class like this: class TestProcess(Process): title = models.CharField(max_length=64) something = models.ForeignKey(ForInheritage, null=True, on_delete=models.CASCADE) no_approval = models.BooleanField(default=False) approved = models.BooleanField(default=False) def something_is_approved(self): try: return self

ViewFlow and django-guardian

本小妞迷上赌 提交于 2021-02-08 08:10:19
问题 I want to make use of django-guardian 's object permissions and grant specific rights for specific users to one or more Django users. I have tried to add some permissions to my Process class like this: class TestProcess(Process): title = models.CharField(max_length=64) something = models.ForeignKey(ForInheritage, null=True, on_delete=models.CASCADE) no_approval = models.BooleanField(default=False) approved = models.BooleanField(default=False) def something_is_approved(self): try: return self

Overwrite django view with custom context (Django 1.11, Viewflow)

こ雲淡風輕ζ 提交于 2021-02-07 09:11:10
问题 I have a Django 1.11 project using Viewflow - https://github.com/viewflow/viewflow - that I've incorporated. It's been very helpful, but a lot of stuff is kind of "magic", and being my first serious Django project, I'm running into an issue I'm not sure of how to solve, or the best way. I have a generic template that expects a lot of context. I have a function that adds this context to all of my views: def add_general_context(context, MOC, MOC_enabled_fields = (), MOC_status = None): context[

Django Viewflow - Return Handler Response

£可爱£侵袭症+ 提交于 2019-12-25 04:13:34
问题 Following is my flow:- class APLWorkflow(Flow): start = ( flow.StartFunction(function1) .Next(this.request_quotes) ) request_quotes = ( flow.Handler(function2) .Next(this.move_package) ) move_package = ( flow.Handler(function3) .Next(this.shipment_create) ) shipment_create = ( flow.Function(function4) .Next(this.end) ) end = flow.End() Following are my util functions:- def function1(): return 1 def function2(): return 2 def function3(): return 3 def function4(): return 4 The problem is when I

Viewflow - start process with Django model post_save signal

≯℡__Kan透↙ 提交于 2019-12-24 20:38:12
问题 Is there a way to start a Viewflow process with Django model post_save signal. I managed to do this: //start viewflow process start = ( flow.StartSignal(post_save, create_dest_flow) .Next(this.approve) ) //create flow function def create_dest_flow(**kwargs): print("Test") pass The "Test" string is printed for every save on any model. If I add activation to the create flow function parameteres I get an error: missing 1 required positional argument: 'activation' . How to start the flow only on

Django viewflows - Defining an API flow

こ雲淡風輕ζ 提交于 2019-12-13 17:32:34
问题 I've an API endpoint, /api/create/ . This creates a new entry in the DB depending upon the payload received from the client. Payload - { 'field1': 'value1`, 'field2': 'value2`, 'field3': 'value3`, 'field4': 'value4`, 'type': 'A' } Now depending on the type , I've a specific workflow. For eg:- Type A needs to perform certain tasks before saving the data, Type B has its own set of operations. I don't have any UI, just the requests coming over the POST request. How can I use django-viewflows for

designing models in django-viewflow

旧街凉风 提交于 2019-12-11 15:49:34
问题 I am new to django-viewflow and still going through the viewflow related documents including cook-book examples. In the project that I am working on, I have below models. class FirstModel(models.Model): prod_ref_num = models.IntegerField() prod_part_num = models.IntegerField() The above model FirstModel is being updated by external process class SecondModel(models.Model): prod_type = models.CharField(max_length=30) prod_category = models.CharField(max_length=30) approved = models.BooleanField

viewflow.io: implementing a queue task

∥☆過路亽.° 提交于 2019-12-05 00:00:57
问题 I would like to implement the following use case with the ViewFlow library: Problem Processes of a particular Flow, started by a user, must wait in a queue before executing a celery job. Each user has a queue of these processes. Based on a schedule, or triggered manually, the next process in the queue is allowed to proceed. Example A node within my flow enters a named queue. Other logic within the application determines, for each queue, when to allow the next task to proceed. The next task in