##// END OF EJS Templates
Test Version
Test Version

File last commit:

r22:3d86891def25
r22:3d86891def25
Show More
models.py
31 lines | 768 B | text/x-python | PythonLexer
# -*- coding: utf-8 -*-
from django.db import models
from mongoengine import Document, IntField, FloatField, StringField, DictField, ListField, DateTimeField, ReferenceField
class Experiment(Document):
code = IntField(unique=True)
name = StringField(max_length=40)
class ExpDetail(Document):
experiment = ReferenceField(Experiment)
date = DateTimeField()
last_time = FloatField()
def plots(self):
return PlotMeta.objects(exp_detail=self)
class PlotMeta(Document):
exp_detail = ReferenceField(ExpDetail)
metadata = DictField()
plot = StringField()
class PlotData(Document):
plot = ReferenceField(PlotMeta)
time = FloatField()
data = ListField()
meta = {
'indexes': ["plot", "+time"]
}