Commit d0aace27 authored by Izidorf's avatar Izidorf
Browse files

requirements

parents 65698c79 3d4c5605
......@@ -24,4 +24,5 @@ mothra-env/
build/
# SQLite
/mothra/mothra.db
\ No newline at end of file
/mothra/mothra.db
/mothra/mothra.db-journal
......@@ -4,7 +4,7 @@ from fabric.colors import *
from fabric.utils import puts, abort
env.use_ssh_config = True
apps_to_migrate = ('workflows',)
apps_to_migrate = ('workflows','streams',)
def live():
""" doloci live server kot aktivni """
......@@ -33,13 +33,25 @@ def deploy():
puts(yellow("[Collecting static files]"))
run("python manage.py collectstatic --noinput")
puts(yellow("[Auto importing packages]"))
run("python manage.py auto_import_packages")
with cd('/srv/django-projects/supervisor'):
puts(yellow("[Restarting the run streams daemon"))
run('supervisorctl restart runstreams')
#puts(yellow("[Compressing]"))
#run('python manage.py compress')
def supervisorstat():
"supervisor statistika na serverju"
with prefix('source /srv/django-envs/mothra/bin/activate'):
with cd('/srv/django-projects/supervisor'):
run('tail /srv/django-logs/runstreams.stdout.log')
run('supervisorctl status')
def apache_restart():
"""restarta apache service
primer:
......
......@@ -175,21 +175,22 @@ INSTALLED_APPS_DEFAULT = (
'django.contrib.humanize',
'orderable_inlines',
'workflows',
'picklefield'
'picklefield',
'streams',
)
INSTALLED_APPS_CONCUR = (
'djcelery',
) if USE_CONCURRENCY else (
'streams',
)
INSTALLED_APPS_WORKFLOWS_SUB = (
'workflows.base',
'workflows.latino',
#'workflows.latino',
'workflows.decision_support',
'workflows.segmine',
'workflows.subgroup_discovery',
#'workflows.subgroup_discovery',
'workflows.nlp',
'workflows.nl_toolkit',
'workflows.ilp',
......@@ -197,9 +198,15 @@ INSTALLED_APPS_WORKFLOWS_SUB = (
'workflows.cforange',
'workflows.perfeval',
'workflows.mysql',
<<<<<<< HEAD
'workflows.lemmagen',
'workflows.crossbee',
'workflows.scikitAlgorithms',
=======
#'workflows.lemmagen',
#'workflows.crossbee',
'workflows.streaming',
>>>>>>> 3d4c5605eb0cc9b6e49e1daeb50a05f2accc9d75
#WORKFLOWS_SUBAPP_PLACEHOLDER
)
......
......@@ -18,23 +18,24 @@ urlpatterns = patterns('',
url(r'^', include('signuplogin.urls')),
url(r'^', include('website.urls')),
url(r'^workflows/', include('workflows.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^streams/', include('streams.urls')),
url(r'^admin/', include(admin.site.urls)),
url('^' + LOGIN_URL[1:] + '$', 'django.contrib.auth.views.login', name='login'),
url(r'^logout/$', 'django.contrib.auth.views.logout', name='logout'),
url(r'^change-password/$', 'django.contrib.auth.views.password_change', name='password change'),
url(r'^password-changed/$', 'django.contrib.auth.views.password_change_done', name='password change done'),
url(r'^password_reset/$', 'django.contrib.auth.views.password_reset'),
url(r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done'),
url(r'^reset/(?P<uidb36>[0-9A-Za-z]{1,13})-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', 'django.contrib.auth.views.password_reset_confirm'),
url(r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete'),
)
## debug stuff to serve static media
if DEBUG:
urlpatterns += patterns('',
(r'^media/(?P<path>.*)$', 'django.views.static.serve',
(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': STATIC_DOC_ROOT}),
)
\ No newline at end of file
)
......@@ -7,13 +7,11 @@ django-extensions==0.9
django-orderable-inlines==0.0.6
django-picklefield==0.2.1
httplib2==0.7.5
pyparsing==1.5.6
pydot==1.0.28
wsgiref==0.1.2
mysql-connector-python==1.0.9
# scikit-learn requires
# NumPy>=1.3
# SciPy >= 0.7
# development headers
# working C++ compiler
\ No newline at end of file
numpy==1.7.1
pydot==1.0.28
pyparsing==1.5.7
scikit-learn==0.13.1
scipy==0.12.0
feedparser==5.1.2
from django.core.management.base import NoArgsCommand
from streams.models import *
class Command(NoArgsCommand):
help = 'see a list of all streams'
option_list = NoArgsCommand.option_list
def handle_noargs(self, **options):
import time
self.stdout.write("Working on streams...")
self.stdout.flush()
while True:
streams = Stream.objects.filter(active=True)
for stream in streams:
#self.stdout.write(u"\nChecking stream "+unicode(stream)+"...\n")
#self.stdout.flush()
#preverimo ce je ze dost casa pretekl
import django
now = django.utils.timezone.now()
delta = now - stream.last_executed
delta_seconds = delta.seconds + delta.days * 86400
if delta_seconds > stream.period:
stream.last_executed = now
stream.save()
self.stdout.write(u"<"+str(now)+">Executing "+unicode(stream)+"...")
self.stdout.flush()
stream.execute()
self.stdout.write("done!\n")
self.stdout.flush()
#print stream.execute()
time.sleep(1)
#self.stdout.write(".")
#self.stdout.flush()
from django.core.management.base import NoArgsCommand
from streams.models import *
class Command(NoArgsCommand):
help = 'check for streams that need to be executed and execute them'
option_list = NoArgsCommand.option_list
def handle_noargs(self, **options):
import time
self.stdout.write("Working on streams...")
self.stdout.flush()
while True:
streams = Stream.objects.filter(active=True)
for stream in streams:
#self.stdout.write(u"\nChecking stream "+unicode(stream)+"...\n")
#self.stdout.flush()
#preverimo ce je ze dost casa pretekl
import django
now = django.utils.timezone.now()
delta = now - stream.last_executed
delta_seconds = delta.seconds + delta.days * 86400
if delta_seconds > stream.period:
stream.last_executed = now
stream.save()
self.stdout.write(u"Executing "+unicode(stream)+"...")
self.stdout.flush()
try:
stream.execute()
except:
import traceback
self.stdout.write("\n ERROR in executing stream:\n")
traceback.print_exc(file=self.stdout)
self.stdout.write("done!\n")
self.stdout.flush()
#print stream.execute()
time.sleep(1)
#self.stdout.write(".")
#self.stdout.flush()
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'StreamWidgetData'
db.create_table('streams_streamwidgetdata', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
('stream', self.gf('django.db.models.fields.related.ForeignKey')(related_name='widget_data', to=orm['streams.Stream'])),
('widget', self.gf('django.db.models.fields.related.ForeignKey')(related_name='stream_data', to=orm['workflows.Widget'])),
('value', self.gf('picklefield.fields.PickledObjectField')(null=True)),
))
db.send_create_signal('streams', ['StreamWidgetData'])
# Adding field 'Stream.active'
db.add_column('streams_stream', 'active',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
def backwards(self, orm):
# Deleting model 'StreamWidgetData'
db.delete_table('streams_streamwidgetdata')
# Deleting field 'Stream.active'
db.delete_column('streams_stream', 'active')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'streams.stream': {
'Meta': {'object_name': 'Stream'},
'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'last_executed': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'period': ('django.db.models.fields.IntegerField', [], {'default': '60'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'streams'", 'to': "orm['auth.User']"}),
'workflow': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'streams'", 'to': "orm['workflows.Workflow']"})
},
'streams.streamwidgetdata': {
'Meta': {'object_name': 'StreamWidgetData'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'stream': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'widget_data'", 'to': "orm['streams.Stream']"}),
'value': ('picklefield.fields.PickledObjectField', [], {'null': 'True'}),
'widget': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'stream_data'", 'to': "orm['workflows.Widget']"})
},
'workflows.abstractwidget': {
'Meta': {'ordering': "('order', 'name')", 'object_name': 'AbstractWidget'},
'action': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'category': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'widgets'", 'to': "orm['workflows.Category']"}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'has_progress_bar': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('workflows.thumbs.ThumbnailField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'interaction_view': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200', 'blank': 'True'}),
'interactive': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_streaming': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
'post_interact_action': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200', 'blank': 'True'}),
'treeview_image': ('workflows.thumbs.ThumbnailField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'widgets'", 'null': 'True', 'to': "orm['auth.User']"}),
'visualization_view': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200', 'blank': 'True'}),
'wsdl': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
'wsdl_method': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200', 'blank': 'True'})
},
'workflows.category': {
'Meta': {'ordering': "('order', 'name')", 'object_name': 'Category'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['workflows.Category']"}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'categories'", 'null': 'True', 'to': "orm['auth.User']"}),
'workflow': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'categories'", 'null': 'True', 'to': "orm['workflows.Workflow']"})
},
'workflows.widget': {
'Meta': {'object_name': 'Widget'},
'abstract_widget': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'instances'", 'null': 'True', 'to': "orm['workflows.AbstractWidget']"}),
'error': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'finished': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'interaction_waiting': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'progress': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'running': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'type': ('django.db.models.fields.CharField', [], {'default': "'regular'", 'max_length': '50'}),
'workflow': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'widgets'", 'to': "orm['workflows.Workflow']"}),
'x': ('django.db.models.fields.IntegerField', [], {}),
'y': ('django.db.models.fields.IntegerField', [], {})
},
'workflows.workflow': {
'Meta': {'ordering': "['name']", 'object_name': 'Workflow'},
'description': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'default': "'Untitled workflow'", 'max_length': '200'}),
'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'template_parent': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['workflows.Workflow']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'workflows'", 'to': "orm['auth.User']"}),
'widget': ('django.db.models.fields.related.OneToOneField', [], {'blank': 'True', 'related_name': "'workflow_link'", 'unique': 'True', 'null': 'True', 'to': "orm['workflows.Widget']"})
}
}
complete_apps = ['streams']
\ No newline at end of file
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Stream.workflow'
db.alter_column('streams_stream', 'workflow_id', self.gf('django.db.models.fields.related.OneToOneField')(unique=True, to=orm['workflows.Workflow']))
# Adding unique constraint on 'Stream', fields ['workflow']
db.create_unique('streams_stream', ['workflow_id'])
def backwards(self, orm):
# Removing unique constraint on 'Stream', fields ['workflow']
db.delete_unique('streams_stream', ['workflow_id'])
# Changing field 'Stream.workflow'
db.alter_column('streams_stream', 'workflow_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['workflows.Workflow']))
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'streams.stream': {
'Meta': {'object_name': 'Stream'},
'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'last_executed': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'period': ('django.db.models.fields.IntegerField', [], {'default': '60'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'streams'", 'to': "orm['auth.User']"}),
'workflow': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'streams'", 'unique': 'True', 'to': "orm['workflows.Workflow']"})
},
'streams.streamwidgetdata': {
'Meta': {'object_name': 'StreamWidgetData'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'stream': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'widget_data'", 'to': "orm['streams.Stream']"}),
'value': ('picklefield.fields.PickledObjectField', [], {'null': 'True'}),
'widget': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'stream_data'", 'to': "orm['workflows.Widget']"})
},
'workflows.abstractwidget': {
'Meta': {'ordering': "('order', 'name')", 'object_name': 'AbstractWidget'},
'action': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'category': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'widgets'", 'to': "orm['workflows.Category']"}),
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'has_progress_bar': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'image': ('workflows.thumbs.ThumbnailField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'interaction_view': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200', 'blank': 'True'}),
'interactive': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_streaming': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
'package': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '150', 'blank': 'True'}),
'post_interact_action': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200', 'blank': 'True'}),
'static_image': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '250', 'blank': 'True'}),
'streaming_visualization_view': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200', 'blank': 'True'}),
'treeview_image': ('workflows.thumbs.ThumbnailField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'uid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '250', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'widgets'", 'null': 'True', 'to': "orm['auth.User']"}),
'visualization_view': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200', 'blank': 'True'}),
'wsdl': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
'wsdl_method': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200', 'blank': 'True'})
},
'workflows.category': {
'Meta': {'ordering': "('order', 'name')", 'object_name': 'Category'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['workflows.Category']"}),
'uid': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '250', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'categories'", 'null': 'True', 'to': "orm['auth.User']"}),
'workflow': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'categories'", 'null': 'True', 'to': "orm['workflows.Workflow']"})
},
'workflows.widget': {
'Meta': {'object_name': 'Widget'},
'abstract_widget': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'instances'", 'null': 'True', 'to': "orm['workflows.AbstractWidget']"}),
'error': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'finished': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'interaction_waiting': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'progress': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'running': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'type': ('django.db.models.fields.CharField', [], {'default': "'regular'", 'max_length': '50'}),
'workflow': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'widgets'", 'to': "orm['workflows.Workflow']"}),
'x': ('django.db.models.fields.IntegerField', [], {}),
'y': ('django.db.models.fields.IntegerField', [], {})
},
'workflows.workflow': {
'Meta': {'ordering': "['name']", 'object_name': 'Workflow'},
'description': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'default': "'Untitled workflow'", 'max_length': '200'}),
'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'template_parent': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['workflows.Workflow']", 'null': 'True', 'on_delete': 'models.SET_NULL', 'blank': 'True'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'workflows'", 'to': "orm['auth.User']"}),
'widget': ('django.db.models.fields.related.OneToOneField', [], {'blank': 'True', 'related_name': "'workflow_link'", 'unique': 'True', 'null': 'True', 'to': "orm['workflows.Widget']"})
}
}
complete_apps = ['streams']
\ No newline at end of file
from django.db import models
from workflows.models import Workflow
from workflows.models import Workflow, Widget
from django.contrib.auth.models import User
import workflows.library
from picklefield.fields import PickledObjectField
class HaltStream(Exception):
pass
# Create your models here.
class Stream(models.Model):
user = models.ForeignKey(User,related_name="streams")
workflow = models.ForeignKey(Workflow, related_name="streams")
workflow = models.OneToOneField(Workflow, related_name="stream")
last_executed = models.DateTimeField(auto_now_add=True)
period = models.IntegerField(default=60)
active = models.BooleanField(default=False)
@models.permalink
def get_absolute_url(self):
return ('stream', [str(self.id)])
def stream_visualization_widgets(self):
return self.workflow.widgets.all().exclude(abstract_widget__streaming_visualization_view='')
def reset(self):
self.widget_data.all().delete()
def execute(self,workflow=None,outputs={}):
if<