# Path: goflow/workflow/models.py
# class Activity(models.Model):
#     class Meta:
# class ProcessManager(models.Manager):
# class Process(models.Model):
#     class Meta:
# class Application(models.Model):
# class PushApplication(models.Model):
# class Transition(models.Model):
#     class Meta:
# class UserProfile(models.Model):
#     class Meta:
#     KIND_CHOICES = (
#                     ('standard', 'standard'),
#                     ('dummy', 'dummy'),
#                     ('subflow', 'subflow'),
#                     )
#     COMP_CHOICES = (
#                     ('and', 'and'),
#                     ('xor', 'xor'),
#                     )
#     SUFF_CHOICES = (
#                     ('w', 'workitem.id'),
#                     ('i', 'instance.id'),
#                     ('o', 'object.id'),
#                     )
#     def nb_input_transitions(self):
#     def __unicode__(self):
#     def is_enabled(self, title):
#     def check_can_start(self, process_name, user):
#     def __unicode__(self):
#     def summary(self):
#     def action(self):
#     def add_activity(self, name):
#     def add_transition(self, name, activity_out, activity_in):
#     def create_authorized_group_if_not_exists(self):
#     def save(self, no_end=False):
#     def __unicode__(self):
#     def get_app_url(self, workitem=None, extern_for_user=None):
#     def get_handler(self):
#     def documentation(self):
#     def has_test_env(self):
#     def create_test_env(self, user=None):
#     def remove_test_env(self):
#     def test(self):
#     def get_handler(self):
#     def documentation(self):
#     def execute(self, workitem, **kwargs):
#     def __unicode__(self):
#     def test(self):
#     def is_transition(self):
#     def save(self):
#     def __unicode__(self):
#     def save(self, **kwargs):
#     def check_notif_to_send(self):
#     def notif_sent(self):
# 
# Path: goflow/workflow/views.py
# def cron(request=None):
#     """
#     (**Work In Progress**)
#     TODO: move to instances ?
#     """
#     for t in Transition.objects.filter(condition__contains='workitem.timeout'):
#         workitems = WorkItem.objects.filter(
#             activity=t.input).exclude(status='complete')
#         for wi in workitems:
#             wi.forward(timeout_forwarding=True)
#     
#     if request:
#         request.user.message_set.create(message="cron has run.")
#         if 'HTTP_REFERER' in request.META:
#             url = request.META['HTTP_REFERER']
#         else:
#             url = 'home/'
#         return HttpResponseRedirect(url)


import  os, sys
from goflow.workflow.models import WorkItem
from goflow.workflow.views import cron
from goflow.workflow.applications import send_mail
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
'''
TODO: this needs to be rewritten completely

'''

os.environ["DJANGO_SETTINGS_MODULE"]="leavedemo.settings"
_dir = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(_dir, '..'))


#from django.core.urlresolvers import resolve

#cron()       
user = User.objects.get(username='admin')

# Path: goflow/workflow/models.py
# class Activity(models.Model):
#     class Meta:
# class ProcessManager(models.Manager):
# class Process(models.Model):
#     class Meta:
# class Application(models.Model):
# class PushApplication(models.Model):
# class Transition(models.Model):
#     class Meta:
# class UserProfile(models.Model):
#     class Meta:
#     KIND_CHOICES = (
#                     ('standard', 'standard'),
#                     ('dummy', 'dummy'),
#                     ('subflow', 'subflow'),
#                     )
#     COMP_CHOICES = (
#                     ('and', 'and'),
#                     ('xor', 'xor'),
#                     )
#     SUFF_CHOICES = (
#                     ('w', 'workitem.id'),
#                     ('i', 'instance.id'),
#                     ('o', 'object.id'),
#                     )
#     def nb_input_transitions(self):
#     def __unicode__(self):
#     def is_enabled(self, title):
#     def check_can_start(self, process_name, user):
#     def __unicode__(self):
#     def summary(self):
#     def action(self):
#     def add_activity(self, name):
#     def add_transition(self, name, activity_out, activity_in):
#     def create_authorized_group_if_not_exists(self):
#     def save(self, no_end=False):
#     def __unicode__(self):
#     def get_app_url(self, workitem=None, extern_for_user=None):
#     def get_handler(self):
#     def documentation(self):
#     def has_test_env(self):
#     def create_test_env(self, user=None):
#     def remove_test_env(self):
#     def test(self):
#     def get_handler(self):
#     def documentation(self):
#     def execute(self, workitem, **kwargs):
#     def __unicode__(self):
#     def test(self):
#     def is_transition(self):
#     def save(self):
#     def __unicode__(self):
#     def save(self, **kwargs):
#     def check_notif_to_send(self):
#     def notif_sent(self):
# 
# Path: goflow/workflow/views.py
# def cron(request=None):
#     """
#     (**Work In Progress**)
#     TODO: move to instances ?
#     """
#     for t in Transition.objects.filter(condition__contains='workitem.timeout'):
#         workitems = WorkItem.objects.filter(
#             activity=t.input).exclude(status='complete')
#         for wi in workitems:
#             wi.forward(timeout_forwarding=True)
#     
#     if request:
#         request.user.message_set.create(message="cron has run.")
#         if 'HTTP_REFERER' in request.META:
#             url = request.META['HTTP_REFERER']
#         else:
#             url = 'home/'
#         return HttpResponseRedirect(url)


# Path: leavedemo/test.py
import  os, sys
from goflow.workflow.models import WorkItem
from goflow.workflow.views import cron
from goflow.workflow.applications import send_mail

#!/usr/local/bin/python
# -*- coding: utf-8 -*-
'''
TODO: this needs to be rewritten completely

'''

os.environ["DJANGO_SETTINGS_MODULE"]="leavedemo.settings"
_dir = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(_dir, '..'))


#from django.core.urlresolvers import resolve

#cron()       
user = User.objects.get(username='admin')

wi = WorkItem.objects.get(id=1)