| author | wakimd |
| Tue, 05 Oct 2010 18:19:44 +0200 | |
| changeset 91 | 9c83809fda01 |
| parent 72 | d672f33a3a67 |
| child 94 | 9927a619d2b5 |
| permissions | -rw-r--r-- |
| 32 | 1 |
from django.conf import settings |
| 0 | 2 |
from django.db import models |
| 32 | 3 |
from django.utils.translation import ugettext_lazy as _ |
| 0 | 4 |
from ldt.core.models import Document, Owner |
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
5 |
from django.contrib.auth.models import User |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
6 |
import tagging.fields |
| 41 | 7 |
from utils import create_ldt, copy_ldt, create_empty_iri, update_iri, generate_uuid |
| 32 | 8 |
import lxml.etree |
| 0 | 9 |
import os.path |
10 |
import uuid |
|
| 91 | 11 |
import lucene |
12 |
from ldt.ldt_utils import STORE, ANALYZER |
|
| 0 | 13 |
|
14 |
class Author(models.Model): |
|
15 |
||
16 |
handle = models.CharField(max_length=512, unique=True, blank=True, null=True) |
|
17 |
email = models.EmailField(unique=False, blank=True, null=True) |
|
18 |
firstname = models.CharField(max_length=512, blank=True, null=True) |
|
19 |
lastname = models.CharField(max_length=512, blank=True, null=True) |
|
20 |
||
21 |
def __unicode__(self): |
|
22 |
return unicode(self.id) + " - " + self.handle + ", " + self.email + ", " + self.firstname + " " + self.lastname |
|
23 |
||
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
24 |
class Media(models.Model): |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
25 |
external_id = models.CharField(max_length=1024, null=True, blank=True, verbose_name=_('media.external_id')) |
| 62 | 26 |
external_permalink = models.URLField(max_length=1024, null=True, blank=True, verbose_name=_('content.external_permalink')) |
27 |
external_publication_url = models.URLField(max_length=1024, null=True, blank=True, verbose_name=_('content.external_publication_url')) |
|
28 |
external_src_url = models.URLField(max_length=1024, null=True, blank=True, verbose_name=_('content.external_publication_url')) |
|
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
29 |
creation_date = models.DateTimeField(auto_now_add=True, verbose_name=_('media.creation_date')) |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
30 |
media_creation_date = models.DateTimeField(null=True, blank=True, verbose_name=_('media.media_creation_date')) |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
31 |
update_date = models.DateTimeField(auto_now=True, verbose_name=_('media.update_date')) |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
32 |
videopath = models.CharField(max_length=1024, null=True, blank=True, verbose_name=_('media.videopath')) |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
33 |
duration = models.IntegerField(null=True, blank=True, verbose_name=_('media.duration')) |
| 62 | 34 |
creator = models.ForeignKey(User, blank=True, null=True, verbose_name=_('media.creator')) |
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
35 |
description = models.TextField(null=True, blank=True, verbose_name=_('description')) |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
36 |
title = models.CharField(max_length=1024, null=True, blank=True, verbose_name=_('title')) |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
37 |
src = models.CharField(max_length=1024, unique=True, verbose_name=_('media.src')) |
| 62 | 38 |
|
|
71
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
39 |
def stream_src(): |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
40 |
|
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
41 |
def fget(self): |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
42 |
res_src = self.src.rstrip() |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
43 |
if self.videopath and self.videopath.startswith("rtmp://"): |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
44 |
extension = res_src.split(".")[-1] |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
45 |
res_src = { |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
46 |
'flv': lambda s: s, |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
47 |
'mp3': lambda s: "%s:%s" %("mp3",res_src[:-4]), |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
48 |
'mp4': lambda s: "%s:%s" %("mp4",res_src[:-4]), |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
49 |
'f4v': lambda s: "%s:%s" %("mp4",res_src[:-4]), |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
50 |
}.get(extension, lambda s:s)(res_src) |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
51 |
return res_src |
| 72 | 52 |
|
53 |
return locals() |
|
54 |
||
|
71
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
55 |
stream_src = property(**stream_src()) |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
56 |
|
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
57 |
def save(self, *args, **kwargs): |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
58 |
super(Media, self).save(*args, **kwargs) |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
59 |
for content in self.content_set.all(): |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
60 |
content.sync_iri_file() |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
61 |
|
| 62 | 62 |
def __unicode__(self): |
63 |
strings = [] |
|
64 |
if self.title: |
|
65 |
strings.append(unicode(self.title)) |
|
66 |
else: |
|
67 |
strings.append(unicode(self.src)) |
|
68 |
if self.external_id: |
|
69 |
strings.append(unicode(self.external_id)) |
|
70 |
return "|".join(strings) |
|
| 0 | 71 |
|
|
71
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
72 |
|
| 0 | 73 |
class Content(models.Model): |
| 44 | 74 |
iri_id = models.CharField(max_length=1024, unique=True, default=generate_uuid, verbose_name=_('content.iri_id')) |
75 |
iriurl = models.CharField(max_length=1024, verbose_name=_('content.iriurl')) |
|
76 |
creation_date = models.DateTimeField(auto_now_add=True, verbose_name=_('content.creation_date')) |
|
77 |
update_date = models.DateTimeField(auto_now=True, verbose_name=_('content.update_date')) |
|
78 |
title = models.CharField(max_length=1024, null=True, blank=True, verbose_name=_('content.title')) |
|
79 |
description = models.TextField(null=True, blank=True, verbose_name=_('content.description')) |
|
80 |
authors = models.ManyToManyField(Author, blank=True, verbose_name=_('content.authors')) |
|
81 |
duration = models.IntegerField(null=True, blank=True, verbose_name=_('content.duration')) |
|
82 |
content_creation_date = models.DateTimeField(null=True, blank=True, verbose_name=_('content.content_creation_date')) |
|
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
83 |
tags = tagging.fields.TagField(max_length=2048, null=True, blank=True ) |
| 62 | 84 |
media_obj = models.ForeignKey('Media', blank=True, null=True ) |
| 0 | 85 |
|
86 |
def get_duration(self): |
|
87 |
if self.duration is None: |
|
| 32 | 88 |
doc = lxml.etree.parse(self.iri_file_path()) |
89 |
res = doc.xpath("/iri/body/medias/media[@id='video']/video") |
|
90 |
self.duration = int(res[0].get(u'dur') or 0) |
|
| 0 | 91 |
self.save() |
92 |
return self.duration |
|
93 |
||
94 |
def delete(self): |
|
95 |
super(Content, self).delete() |
|
96 |
writer = lucene.IndexWriter(STORE, ANALYZER, True, lucene.IndexWriter.MaxFieldLength.UNLIMITED) |
|
97 |
writer.deleteDocuments(lucene.Term("iri_id", self.iri_id)) |
|
98 |
writer.commit() |
|
99 |
||
|
71
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
100 |
def sync_iri_file(self): |
| 0 | 101 |
# create iri file if needed |
| 5 | 102 |
created = False |
| 0 | 103 |
try: |
104 |
iri_file_path = self.iri_file_path() |
|
105 |
if not os.path.exists(iri_file_path): |
|
106 |
dir = os.path.dirname(iri_file_path) |
|
107 |
if not os.path.exists(dir): |
|
108 |
os.makedirs(dir) |
|
| 5 | 109 |
created = True |
| 0 | 110 |
file = open(iri_file_path,"w") |
111 |
create_empty_iri(file, self, "IRI") |
|
| 5 | 112 |
else: |
113 |
created = False |
|
114 |
update_iri(iri_file_path, self, "IRI") |
|
115 |
||
| 0 | 116 |
except Exception, e: |
| 5 | 117 |
if created: |
118 |
if os.path.exists(iri_file_path): |
|
119 |
os.remove(iri_file_path) |
|
120 |
raise e |
|
| 41 | 121 |
|
|
71
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
122 |
|
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
123 |
#TODO: better manage the change in .iri name and error scenario (save in temp file + rename |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
124 |
def save(self, *args, **kwargs): |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
125 |
|
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
126 |
self.sync_iri_file() |
| 0 | 127 |
# update it |
| 32 | 128 |
super(Content, self).save(*args, **kwargs) |
| 0 | 129 |
|
130 |
def __unicode__(self): |
|
131 |
return str(self.id) + ": " + self.iri_id |
|
132 |
||
133 |
def iri_url(self, web_url=settings.WEB_URL): |
|
134 |
if 'http' in self.iriurl or 'https' in self.iriurl: |
|
135 |
return self.iriurl |
|
136 |
else: |
|
137 |
return unicode(web_url) + unicode(settings.MEDIA_URL)+u"media/ldt/"+unicode(self.iriurl) |
|
138 |
||
139 |
def iri_file_path(self): |
|
140 |
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)) |
|
141 |
||
142 |
def iri_url_template(self): |
|
143 |
return "${web_url}${media_url}media/ldt/" + unicode(self.iri_id) + "/" + os.path.basename(self.iriurl) |
|
| 62 | 144 |
|
145 |
||
146 |
def __get_empty_media(self): |
|
147 |
if settings.EMPTY_MEDIA_EXTERNALID: |
|
148 |
empty_media = Media.objects.get(externalid=settings.EMPTY_MEDIA_EXTERNALID) |
|
149 |
return empty_media |
|
150 |
else: |
|
151 |
return None |
|
152 |
||
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
153 |
|
|
71
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
154 |
def stream_src(): |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
155 |
|
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
156 |
def fget(self): |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
157 |
if self.media_obj is not None: |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
158 |
return self.media_obj.stream_src |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
159 |
else: |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
160 |
return None |
| 72 | 161 |
|
162 |
return locals() |
|
163 |
||
|
71
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
164 |
stream_src = property(**stream_src()) |
|
fc1210bbb854
correct translation +some bug on update
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
165 |
|
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
166 |
def videopath(): #@NoSelf |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
167 |
doc = """simulate videopath""" #@UnusedVariable |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
168 |
|
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
169 |
def fget(self): |
| 62 | 170 |
if self.media_obj is None: |
171 |
empty_media = self.__get_empty_media() |
|
172 |
if empty_media: |
|
173 |
return empty_media.videopath |
|
174 |
else: |
|
175 |
return None |
|
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
176 |
else: |
| 62 | 177 |
return self.media_obj.videopath |
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
178 |
|
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
179 |
def fset(self, value): |
| 62 | 180 |
if self.media_obj is not None: |
181 |
self.media_obj.videopath = value |
|
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
182 |
|
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
183 |
return locals() |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
184 |
|
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
185 |
videopath = property(**videopath()) |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
186 |
|
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
187 |
def src(): #@NoSelf |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
188 |
doc = """simulate videopath""" #@UnusedVariable |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
189 |
|
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
190 |
def fget(self): |
| 62 | 191 |
if self.media_obj is None: |
192 |
empty_media = self.__get_empty_media() |
|
193 |
if empty_media: |
|
194 |
return empty_media.src |
|
195 |
else: |
|
196 |
return None |
|
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
197 |
else: |
| 62 | 198 |
return self.media_obj.src |
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
199 |
|
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
200 |
def fset(self, value): |
| 62 | 201 |
if self.media_obj is None or self.media_obj.src != value: |
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
202 |
media, created = Media.objects.get_or_create(src=value, defaults={'src':value}) |
| 62 | 203 |
self.media_obj = media |
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
204 |
self.save() |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
205 |
|
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
206 |
return locals() |
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
207 |
|
|
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
208 |
src = property(**src()) |
| 63 | 209 |
|
| 67 | 210 |
def external_id(): #@NoSelf |
| 63 | 211 |
doc = """simulate externalid""" #@UnusedVariable |
212 |
||
213 |
def fget(self): |
|
214 |
if self.media_obj is None: |
|
215 |
empty_media = self.__get_empty_media() |
|
216 |
if empty_media: |
|
| 67 | 217 |
return empty_media.external_id |
| 63 | 218 |
else: |
219 |
return None |
|
220 |
else: |
|
| 67 | 221 |
return self.media_obj.external_id |
| 63 | 222 |
|
223 |
def fset(self, value): |
|
224 |
if self.media_obj is not None: |
|
| 67 | 225 |
self.media_obj.external_id = value |
| 63 | 226 |
|
227 |
return locals() |
|
228 |
||
| 67 | 229 |
external_id = property(**external_id()) |
| 63 | 230 |
|
| 0 | 231 |
|
232 |
||
233 |
class Project(Document): |
|
234 |
STATE_CHOICES=( |
|
235 |
(1, 'edition'), |
|
236 |
(2, 'published'), |
|
237 |
(3, 'moderated'), |
|
238 |
(4, 'rejected'), |
|
239 |
(5, 'deleted') |
|
240 |
) |
|
241 |
ldt_id = models.CharField(max_length=1024, unique=True) |
|
242 |
ldt = models.TextField(null=True) |
|
243 |
title = models.CharField(max_length=1024) |
|
244 |
contents = models.ManyToManyField(Content) |
|
245 |
creation_date = models.DateTimeField(auto_now_add=True) |
|
246 |
modification_date = models.DateTimeField(auto_now=True) |
|
247 |
created_by = models.CharField(_("created by"), max_length=70) |
|
248 |
changed_by = models.CharField(_("changed by"), max_length=70) |
|
249 |
state = models.IntegerField(choices=STATE_CHOICES, default=1) |
|
250 |
||
251 |
def __unicode__(self): |
|
252 |
return unicode(self.id) + u": " + unicode(self.ldt_id) |
|
253 |
||
254 |
def get_description(self, doc=None): |
|
255 |
||
256 |
if doc is None: |
|
| 32 | 257 |
doc = lxml.etree.fromstring(self.ldt) |
| 0 | 258 |
|
| 32 | 259 |
res = doc.xpath("/iri/project") |
| 0 | 260 |
if len(res) > 0: |
| 32 | 261 |
return res[0].get(u'abstract') |
| 0 | 262 |
else: |
263 |
return None |
|
264 |
||
265 |
||
266 |
@staticmethod |
|
267 |
def create_project(user, title, contents): |
|
268 |
owner = Owner.objects.get(user=user) |
|
269 |
project = Project(title=title, owner=owner) |
|
270 |
project.ldt_id = str(uuid.uuid1()) |
|
271 |
project.created_by=user.username |
|
272 |
project.changed_by=user.username |
|
273 |
project.state = 1 |
|
274 |
project.save() |
|
275 |
for content in contents: |
|
276 |
project.contents.add(content) |
|
277 |
project.save() |
|
278 |
return create_ldt(project, user) |
|
279 |
||
280 |
def copy_project(self, user, title): |
|
281 |
owner = Owner.objects.get(user=user) |
|
282 |
project = Project(title=title, owner=owner) |
|
283 |
project = copy_ldt(self, project, user) |
|
284 |
project.save() |
|
285 |
for content in self.contents.all(): |
|
286 |
project.contents.add(content) |
|
287 |
project.save() |
|
288 |
return project |
|
289 |
||
290 |
class Segment(models.Model): |
|
291 |
||
292 |
project_obj = models.ForeignKey(Project, null=True) |
|
293 |
content = models.ForeignKey(Content) |
|
294 |
project_id = models.CharField(max_length=1024, unique=False, blank=True, null=True) |
|
295 |
iri_id = models.CharField(max_length=1024, unique=False) |
|
296 |
ensemble_id = models.CharField(max_length=1024, unique=False) |
|
297 |
cutting_id = models.CharField(max_length=1024, unique=False) |
|
298 |
element_id = models.CharField(max_length=1024, unique=False) |
|
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
299 |
tags = tagging.fields.TagField(max_length=2048, null=True, blank=True, unique=False) |
| 0 | 300 |
title = models.CharField(max_length=2048, unique=False, null=True, blank=True) |
301 |
duration = models.IntegerField(null=True) |
|
302 |
start_ts = models.IntegerField(null=True) |
|
303 |
author = models.CharField(max_length=1024, unique=False, null=True, blank=True) |
|
304 |
date = models.CharField(max_length=128, unique=False, null=True, blank=True) |
|
305 |
abstract = models.TextField(null=True, blank=True) |
|
306 |
||
307 |
def __unicode__(self): |
|
308 |
return "/".join((unicode(self.project_id), unicode(self.iri_id), unicode(self.ensemble_id), unicode(self.cutting_id), unicode(self.element_id))) |
|
309 |
||
310 |
class Meta: |
|
311 |
unique_together = (('project_id', 'iri_id', 'ensemble_id', 'cutting_id', 'element_id'),) |
|
312 |
||
|
60
a8ad7ebf5902
various update and splitmedia from content
ymh <ymh.work@gmail.com>
parents:
44
diff
changeset
|
313 |