author | ymh <ymh.work@gmail.com> |
Thu, 10 Jun 2010 18:56:59 +0200 | |
changeset 16 | b3692a42ac79 |
parent 10 | 84e31387a741 |
child 41 | 73753ea1dcef |
child 54 | 24397932219d |
permissions | -rw-r--r-- |
5
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
from django.db import models |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
from django.conf import settings |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
from ldt.core.models import Document, Owner |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
from django.utils.translation import ugettext_lazy as _ |
16 | 5 |
from utils import create_ldt, copy_ldt, create_empty_iri |
7 | 6 |
import os |
7 |
import os.path |
|
5
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
import uuid |
10 | 9 |
import xml |
5
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
class Author(models.Model): |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
13 |
handle = models.CharField(max_length=512, unique=True, blank=True, null=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
14 |
email = models.EmailField(unique=False, blank=True, null=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
15 |
firstname = models.CharField(max_length=512, blank=True, null=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
16 |
lastname = models.CharField(max_length=512, blank=True, null=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
def __unicode__(self): |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
19 |
return unicode(self.id) + " - " + self.handle + ", " + self.email + ", " + self.firstname + " " + self.lastname |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
20 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
21 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
22 |
class Content(models.Model): |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
23 |
iri_id = models.CharField(max_length=1024, unique=True) |
10 | 24 |
iriurl = models.CharField(max_length=1024) |
25 |
src = models.CharField(max_length=1024) |
|
26 |
videopath = models.CharField(max_length=1024, null=True, blank=True) |
|
5
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
27 |
creation_date = models.DateTimeField(auto_now_add=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
28 |
update_date = models.DateTimeField(auto_now=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
29 |
title = models.CharField(max_length=1024, null=True, blank=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
30 |
description = models.TextField(null=True, blank=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
31 |
external_id = models.CharField(max_length=1024, null=True, blank=True) |
10 | 32 |
authors = models.ManyToManyField(Author, blank=True) |
5
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
33 |
duration = models.IntegerField(null=True, blank=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
34 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
35 |
def get_duration(self): |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
36 |
if self.duration is None: |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
37 |
doc = xml.dom.minidom.parse(self.iri_file_path()) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
38 |
doc = Ft.Xml.Domlette.ConvertDocument(doc) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
39 |
con = xml.xpath.Context.Context(doc, 1, 1, None) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
40 |
res = xml.xpath.Evaluate("/iri/body/medias/media[@id='video']/video", context=con) |
10 | 41 |
self.duration = int(res[0].getAttributeNS(None, u'dur')) |
5
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
42 |
self.save() |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
43 |
return self.duration |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
44 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
45 |
def delete(self): |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
46 |
super(Content, self).delete() |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
47 |
writer = lucene.IndexWriter(STORE, ANALYZER, True, lucene.IndexWriter.MaxFieldLength.UNLIMITED) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
48 |
writer.deleteDocuments(lucene.Term("iri_id", self.iri_id)) |
7 | 49 |
writer.commit() |
50 |
||
51 |
def save(self): |
|
52 |
# create iri file if needed |
|
16 | 53 |
try: |
54 |
iri_file_path = self.iri_file_path() |
|
55 |
if not os.path.exists(iri_file_path): |
|
56 |
dir = os.path.dirname(iri_file_path) |
|
57 |
if not os.path.exists(dir): |
|
58 |
os.makedirs(dir) |
|
59 |
file = open(iri_file_path,"w") |
|
60 |
create_empty_iri(file, self, "IRI") |
|
61 |
except Exception, e: |
|
62 |
if os.path.exists(iri_file_path): |
|
63 |
os.remove(iri_file_path) |
|
64 |
raise e |
|
7 | 65 |
# update it |
66 |
super(Content, self).save() |
|
5
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
67 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
68 |
def __unicode__(self): |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
69 |
return str(self.id) + ": " + self.iri_id |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
70 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
71 |
def iri_url(self, web_url=settings.WEB_URL): |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
72 |
if 'http' in self.iriurl or 'https' in self.iriurl: |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
73 |
return self.iriurl |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
74 |
else: |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
75 |
return unicode(web_url) + unicode(settings.MEDIA_URL)+u"media/ldt/"+unicode(self.iriurl) |
7 | 76 |
|
77 |
def iri_file_path(self): |
|
10 | 78 |
return os.path.join(os.path.join(os.path.join(os.path.join(settings.MEDIA_ROOT, "media"), "ldt"), self.iri_id), os.path.basename(self.iriurl)) |
7 | 79 |
|
80 |
def iri_url_template(self): |
|
10 | 81 |
return "${web_url}${media_url}media/ldt/" + unicode(self.iri_id) + "/" + os.path.basename(self.iriurl) |
5
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
82 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
83 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
84 |
class Project(Document): |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
85 |
STATE_CHOICES=( |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
86 |
(1, 'edition'), |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
87 |
(2, 'published'), |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
88 |
(3, 'moderated'), |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
89 |
(4, 'rejected'), |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
90 |
(5, 'deleted') |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
91 |
) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
92 |
ldt_id = models.CharField(max_length=1024, unique=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
93 |
ldt = models.TextField(null=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
94 |
title = models.CharField(max_length=1024) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
95 |
contents = models.ManyToManyField(Content) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
96 |
creation_date = models.DateTimeField(auto_now_add=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
97 |
modification_date = models.DateTimeField(auto_now=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
98 |
created_by = models.CharField(_("created by"), max_length=70) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
99 |
changed_by = models.CharField(_("changed by"), max_length=70) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
100 |
state = models.IntegerField(choices=STATE_CHOICES, default=1) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
101 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
102 |
def __unicode__(self): |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
103 |
return unicode(self.id) + u": " + unicode(self.ldt_id) |
7 | 104 |
|
105 |
def get_description(self, doc=None): |
|
106 |
||
107 |
if doc is None: |
|
108 |
doc = xml.dom.minidom.parseString(self.ldt) |
|
109 |
doc = Ft.Xml.Domlette.ConvertDocument(doc) |
|
110 |
||
111 |
con = xml.xpath.Context.Context(doc, 1, 1, None) |
|
112 |
res = xml.xpath.Evaluate("/iri/project", context=con) |
|
113 |
if len(res) > 0: |
|
10 | 114 |
return res[0].getAttributeNS(None, u'abstract') |
7 | 115 |
else: |
116 |
return None |
|
117 |
||
5
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
118 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
119 |
@staticmethod |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
120 |
def create_project(user, title, contents): |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
121 |
owner = Owner.objects.get(user=user) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
122 |
project = Project(title=title, owner=owner) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
123 |
project.ldt_id = str(uuid.uuid1()) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
124 |
project.created_by=user.username |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
125 |
project.changed_by=user.username |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
126 |
project.state = 1 |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
127 |
project.save() |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
128 |
for content in contents: |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
129 |
project.contents.add(content) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
130 |
project.save() |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
131 |
return create_ldt(project, user) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
132 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
133 |
def copy_project(self, user, title): |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
134 |
owner = Owner.objects.get(user=user) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
135 |
project = Project(title=title, owner=owner) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
136 |
project = copy_ldt(self, project, user) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
137 |
project.save() |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
138 |
for content in self.contents.all(): |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
139 |
project.contents.add(content) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
140 |
project.save() |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
141 |
return project |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
142 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
143 |
class Segment(models.Model): |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
144 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
145 |
project_obj = models.ForeignKey(Project, null=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
146 |
content = models.ForeignKey(Content) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
147 |
project_id = models.CharField(max_length=1024, unique=False, blank=True, null=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
148 |
iri_id = models.CharField(max_length=1024, unique=False) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
149 |
ensemble_id = models.CharField(max_length=1024, unique=False) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
150 |
cutting_id = models.CharField(max_length=1024, unique=False) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
151 |
element_id = models.CharField(max_length=1024, unique=False) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
152 |
tags = models.CharField(max_length=2048, unique=False, null=True, blank=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
153 |
title = models.CharField(max_length=2048, unique=False, null=True, blank=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
154 |
duration = models.IntegerField(null=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
155 |
start_ts = models.IntegerField(null=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
156 |
author = models.CharField(max_length=1024, unique=False, null=True, blank=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
157 |
date = models.CharField(max_length=128, unique=False, null=True, blank=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
158 |
abstract = models.TextField(null=True, blank=True) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
159 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
160 |
def __unicode__(self): |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
161 |
return "/".join((unicode(self.project_id), unicode(self.iri_id), unicode(self.ensemble_id), unicode(self.cutting_id), unicode(self.element_id))) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
162 |
|
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
163 |
class Meta: |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
164 |
unique_together = (('project_id', 'iri_id', 'ensemble_id', 'cutting_id', 'element_id'),) |
ae8593287883
correct error changing ldt.ldt to ldt.ldt_utils
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
165 |