diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index feffed4..87ae4a7 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.pyc *.pyo *sublime* -python_environment/* \ No newline at end of file +python_environment/* +environment/* diff --git a/api/v10/views.py b/api/v10/views.py old mode 100644 new mode 100755 index a69cc53..4a083aa --- a/api/v10/views.py +++ b/api/v10/views.py @@ -1,5 +1,5 @@ from django.http import HttpResponse -from charts import models +from model import models import json from datetime import datetime import time diff --git a/charts/tests.py b/charts/tests.py deleted file mode 100644 index 178f860..0000000 --- a/charts/tests.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -This file demonstrates writing tests using the unittest module. These will pass -when you run "manage.py test". - -Replace this with more appropriate tests for your application. -""" - -from django.test import TestCase - - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.assertEqual(1 + 1, 2) diff --git a/charts/__init__.py b/model/__init__.py old mode 100644 new mode 100755 similarity index 100% rename from charts/__init__.py rename to model/__init__.py diff --git a/charts/migrations/0001_initial.py b/model/migrations/0001_initial.py old mode 100644 new mode 100755 similarity index 100% rename from charts/migrations/0001_initial.py rename to model/migrations/0001_initial.py diff --git a/charts/migrations/0002_auto_20141007_1601.py b/model/migrations/0002_auto_20141007_1601.py old mode 100644 new mode 100755 similarity index 100% rename from charts/migrations/0002_auto_20141007_1601.py rename to model/migrations/0002_auto_20141007_1601.py diff --git a/charts/migrations/0003_auto_20141008_1252.py b/model/migrations/0003_auto_20141008_1252.py old mode 100644 new mode 100755 similarity index 100% rename from charts/migrations/0003_auto_20141008_1252.py rename to model/migrations/0003_auto_20141008_1252.py diff --git a/charts/migrations/__init__.py b/model/migrations/__init__.py old mode 100644 new mode 100755 similarity index 100% rename from charts/migrations/__init__.py rename to model/migrations/__init__.py diff --git a/charts/models.py b/model/models.py old mode 100644 new mode 100755 similarity index 55% rename from charts/models.py rename to model/models.py index 8b28fd6..2834764 --- a/charts/models.py +++ b/model/models.py @@ -11,6 +11,19 @@ class Chart(models.Model): lastModified = models.DateTimeField() content = JSONField() + def __str__(self): + return self.ownerSource + ":" + self.ownerId + + def setContent(self, _content): + self.content = _content + + +class StudyTemplate(models.Model): + ownerSource = models.CharField(max_length=200) + ownerId = models.CharField(max_length=200) + name = models.CharField(max_length=200) + content = JSONField() + def __str__(self): return self.ownerSource + ":" + self.ownerId