rename: charts -> model

This commit is contained in:
drbeep 2015-05-25 13:50:46 -04:00
parent 22714a9f9f
commit 4c3bb8c6a4
9 changed files with 16 additions and 18 deletions

3
.gitignore vendored Normal file → Executable file
View File

@ -1,4 +1,5 @@
*.pyc *.pyc
*.pyo *.pyo
*sublime* *sublime*
python_environment/* python_environment/*
environment/*

2
api/v10/views.py Normal file → Executable file
View File

@ -1,5 +1,5 @@
from django.http import HttpResponse from django.http import HttpResponse
from charts import models from model import models
import json import json
from datetime import datetime from datetime import datetime
import time import time

View File

@ -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)

0
charts/__init__.py → model/__init__.py Normal file → Executable file
View File

View File

View File

13
charts/models.py → model/models.py Normal file → Executable file
View File

@ -11,6 +11,19 @@ class Chart(models.Model):
lastModified = models.DateTimeField() lastModified = models.DateTimeField()
content = JSONField() 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): def __str__(self):
return self.ownerSource + ":" + self.ownerId return self.ownerSource + ":" + self.ownerId