reduced amount of metadata given on upload
git-svn-id: http://yolanda.mister-muffin.de/svn@422 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
parent
437d38c948
commit
591ae829df
5 changed files with 66 additions and 56 deletions
|
@ -48,12 +48,12 @@ class UploadController(BaseController):
|
||||||
upload.file.seek(0)
|
upload.file.seek(0)
|
||||||
sha256 = hashlib.sha256(upload.file.read(1024*1024)).hexdigest()
|
sha256 = hashlib.sha256(upload.file.read(1024*1024)).hexdigest()
|
||||||
|
|
||||||
# if model.Video.query.filter_by(sha256=sha256).count():
|
if model.Video.query.filter_by(sha256=sha256).count():
|
||||||
# c.message = {
|
c.message = {
|
||||||
# 'type': 'error',
|
'type': 'error',
|
||||||
# 'text': 'Your file was already uploaded. Go away.'
|
'text': 'Your file was already uploaded. Go away.'
|
||||||
# }
|
}
|
||||||
# return render('/xhtml/upload.mako')
|
return render('/xhtml/upload.mako')
|
||||||
|
|
||||||
# TODO: set up safeguards against omitted / wrong data
|
# TODO: set up safeguards against omitted / wrong data
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ class UploadController(BaseController):
|
||||||
|
|
||||||
# Dublin Core terms
|
# Dublin Core terms
|
||||||
dc_title = request.params['dc_title'],
|
dc_title = request.params['dc_title'],
|
||||||
dc_alternative = request.params['dc_title'],
|
# dc_alternative = request.params['dc_title'],
|
||||||
|
|
||||||
# dc_subject = [model.DC_Subject(name=u'lol'), model.DC_Subject(name=u'wut')],
|
# dc_subject = [model.DC_Subject(name=u'lol'), model.DC_Subject(name=u'wut')],
|
||||||
dc_subject = self.getsubjects(),
|
dc_subject = self.getsubjects(),
|
||||||
|
@ -78,24 +78,24 @@ class UploadController(BaseController):
|
||||||
# dc_contributor = [model.DC_Contributor(name=u'lol'), model.DC_Contributor(name=u'wut')],
|
# dc_contributor = [model.DC_Contributor(name=u'lol'), model.DC_Contributor(name=u'wut')],
|
||||||
|
|
||||||
# TODO: insert real data
|
# TODO: insert real data
|
||||||
dc_created = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
# dc_created = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
||||||
dc_valid = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
# dc_valid = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
||||||
dc_available = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
# dc_available = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
||||||
dc_issued = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
# dc_issued = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
||||||
dc_modified = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
# dc_modified = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
||||||
dc_dateAccepted = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
# dc_dateAccepted = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
||||||
dc_dateCopyrighted = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
# dc_dateCopyrighted = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
||||||
dc_dateSubmitted = datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
# dc_dateSubmitted = datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
||||||
|
|
||||||
dc_identifier = '',
|
# dc_identifier = '',
|
||||||
dc_source = '',
|
# dc_source = '',
|
||||||
dc_language = request.params['dc_language'],
|
# dc_language = request.params['dc_language'],
|
||||||
|
|
||||||
# TODO: insert videolength
|
# TODO: insert videolength
|
||||||
dc_extent = timedelta(0),
|
dc_extent = timedelta(0),
|
||||||
|
|
||||||
dc_spatial = request.params['dc_spatial'],
|
# dc_spatial = request.params['dc_spatial'],
|
||||||
dc_temporal = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
# dc_temporal = datetime(9999,9,9).strftime("%Y-%m-%d %H:%M:%S"),
|
||||||
|
|
||||||
dc_rightsHolder = '',
|
dc_rightsHolder = '',
|
||||||
|
|
||||||
|
|
|
@ -25,15 +25,9 @@ class BaseController(WSGIController):
|
||||||
|
|
||||||
def __before__(self):
|
def __before__(self):
|
||||||
|
|
||||||
tags = {}
|
c.tagcloud = {}
|
||||||
for tag in model.DC_Subject.query.all():
|
for tag in model.DC_Subject.query.all():
|
||||||
if tag.name in tags.keys():
|
c.tagcloud[tag.name] = tag.videos.__len__()
|
||||||
tags[tag.name]+=1
|
|
||||||
else:
|
|
||||||
tags[tag.name] = 1
|
|
||||||
c.tagcloud = tags
|
|
||||||
|
|
||||||
print "__before__ %s" % tags
|
|
||||||
|
|
||||||
# Include the '_' function in the public names
|
# Include the '_' function in the public names
|
||||||
__all__ = [__name for __name in locals().keys() if not __name.startswith('_') \
|
__all__ = [__name for __name in locals().keys() if not __name.startswith('_') \
|
||||||
|
|
|
@ -6,31 +6,31 @@ class Video(Entity):
|
||||||
|
|
||||||
# Dublin Core terms
|
# Dublin Core terms
|
||||||
dc_title = Field(Unicode(255))
|
dc_title = Field(Unicode(255))
|
||||||
dc_alternative = Field(Unicode(255))
|
# dc_alternative = Field(Unicode(255))
|
||||||
dc_creator = ManyToOne('DC_Creator')
|
dc_creator = ManyToOne('DC_Creator')
|
||||||
dc_subject = ManyToMany('DC_Subject')
|
dc_subject = ManyToMany('DC_Subject')
|
||||||
|
|
||||||
dc_abstract = Field(UnicodeText)
|
dc_abstract = Field(UnicodeText)
|
||||||
|
|
||||||
dc_contributor = ManyToMany('DC_Contributor')
|
# dc_contributor = ManyToMany('DC_Contributor')
|
||||||
|
|
||||||
dc_created = Field(DateTime)
|
# dc_created = Field(DateTime)
|
||||||
dc_valid = Field(DateTime)
|
# dc_valid = Field(DateTime)
|
||||||
dc_available = Field(DateTime)
|
# dc_available = Field(DateTime)
|
||||||
dc_issued = Field(DateTime)
|
# dc_issued = Field(DateTime)
|
||||||
dc_modified = Field(DateTime)
|
# dc_modified = Field(DateTime)
|
||||||
dc_dateAccepted = Field(DateTime)
|
# dc_dateAccepted = Field(DateTime)
|
||||||
dc_dateCopyrighted = Field(DateTime)
|
# dc_dateCopyrighted = Field(DateTime)
|
||||||
dc_dateSubmitted = Field(DateTime)
|
# dc_dateSubmitted = Field(DateTime)
|
||||||
|
|
||||||
dc_identifier = Field(Unicode(255)) # URI
|
# dc_identifier = Field(Unicode(255)) # URI
|
||||||
dc_source = Field(Unicode(255)) # URI
|
# dc_source = Field(Unicode(255)) # URI
|
||||||
dc_language = Field(Unicode(3)) # see ISO 639-3
|
# dc_language = Field(Unicode(3)) # see ISO 639-3
|
||||||
|
|
||||||
dc_extent = Field(Interval)
|
dc_extent = Field(Interval)
|
||||||
|
|
||||||
dc_spatial = Field(Unicode(255))
|
# dc_spatial = Field(Unicode(255))
|
||||||
dc_temporal = Field(DateTime)
|
# dc_temporal = Field(DateTime)
|
||||||
|
|
||||||
dc_rightsHolder = Field(Unicode(255))
|
dc_rightsHolder = Field(Unicode(255))
|
||||||
|
|
||||||
|
@ -58,10 +58,10 @@ class DC_Subject(Entity):
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<Tag "%s">' % self.name
|
return '<Tag "%s">' % self.name
|
||||||
|
|
||||||
class DC_Contributor(Entity):
|
#class DC_Contributor(Entity):
|
||||||
name = Field(Unicode(255), primary_key = True)
|
# name = Field(Unicode(255), primary_key = True)
|
||||||
videos = ManyToMany('Video')
|
# videos = ManyToMany('Video')
|
||||||
|
|
||||||
def __repr__(self):
|
# def __repr__(self):
|
||||||
return '<Contributor "%s">' % self.name
|
# return '<Contributor "%s">' % self.name
|
||||||
|
|
||||||
|
|
|
@ -103,12 +103,14 @@ method="post">
|
||||||
<li id="upload">
|
<li id="upload">
|
||||||
<a href="${h.url_for('upload')}">Upload</a>
|
<a href="${h.url_for('upload')}">Upload</a>
|
||||||
</li>
|
</li>
|
||||||
|
<!--
|
||||||
<li id="settings">
|
<li id="settings">
|
||||||
<a href="${h.url_for('account-settings')}">Settings</a>
|
<a href="${h.url_for('account-settings')}">Settings</a>
|
||||||
</li>
|
</li>
|
||||||
<li id="logout">
|
<li id="logout">
|
||||||
<a href="${h.url_for('logout')}">Logout</a>
|
<a href="${h.url_for('logout')}">Logout</a>
|
||||||
</li>
|
</li>
|
||||||
|
-->
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -19,26 +19,31 @@
|
||||||
<input name="dc_title" type="text"/>
|
<input name="dc_title" type="text"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--
|
||||||
<div>
|
<div>
|
||||||
<label for="dc_alternative">alternative title</label>
|
<label for="dc_alternative">alternative title</label>
|
||||||
<input name="dc_alternative" type="text"/>
|
<input name="dc_alternative" type="text"/>
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label for="dc_abstract">abstract</label>
|
<label for="dc_abstract">abstract</label>
|
||||||
<textarea name="dc_abstract"/>
|
<textarea name="dc_abstract" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--
|
||||||
<div>
|
<div>
|
||||||
<label for="dc_spatial">spatial</label>
|
<label for="dc_spatial">spatial</label>
|
||||||
<input name="dc_spatial" type="text"/>
|
<input name="dc_spatial" type="text"/>
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label for="dc_subject">keywords (tags), delimited by commas</label>
|
<label for="dc_subject">keywords (tags), delimited by commas</label>
|
||||||
<input name="dc_subject" type="text"/>
|
<input name="dc_subject" type="text"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--
|
||||||
<div>
|
<div>
|
||||||
<label for="dc_temporal">time the document describes (YYYY-MM-DD HH:MM:SS)</label>
|
<label for="dc_temporal">time the document describes (YYYY-MM-DD HH:MM:SS)</label>
|
||||||
<input name="dc_temporal" type="datetime"/>
|
<input name="dc_temporal" type="datetime"/>
|
||||||
|
@ -51,16 +56,25 @@
|
||||||
<option value="eng">English</option>
|
<option value="eng">English</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!--
|
||||||
<div>
|
<div>
|
||||||
<label for="dc_creator">creator</label>
|
<label for="dc_creator">creator</label>
|
||||||
<input name="dc_creator" type="text"/>
|
<input name="dc_creator" type="text"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label for="dc_contributor">contributors, delimited by commas</label>
|
<label for="dc_contributor">contributors, delimited by commas</label>
|
||||||
<input name="dc_contributor" type="text"/>
|
<input name="dc_contributor" type="text"/>
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label for="dc_rightsHolder">rights holder</label>
|
||||||
|
<input name="dc_rightsHolder" type="text"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
$video->appendChild( getElementDC( "contributor", "xsd:normalizedString") );
|
$video->appendChild( getElementDC( "contributor", "xsd:normalizedString") );
|
||||||
|
@ -79,33 +93,33 @@ $video->appendChild( getElementDC( "license", "xsd:normalizedString") );
|
||||||
-->
|
-->
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>
|
<legend>
|
||||||
Remix ?
|
Is modifying the video allowed ?
|
||||||
</legend>
|
</legend>
|
||||||
<label for="cc_remix">
|
<label for="cc_remix">
|
||||||
<input id="cc_remix" type="radio" name="modification" value="remix" />
|
<input id="cc_remix" type="radio" name="modification" value="remix" />
|
||||||
remix
|
<strong>Yes</strong>, remixing is allowed.
|
||||||
</label>
|
</label>
|
||||||
<label for="cc_sharealike">
|
<label for="cc_sharealike">
|
||||||
<input id="cc_sharealike" type="radio" name="modification" value="sharealike" />
|
<input id="cc_sharealike" type="radio" name="modification" value="sharealike" />
|
||||||
sharealike
|
<strong>Yes</strong>, but only if modifications have the same license.
|
||||||
</label>
|
</label>
|
||||||
<label for="cc_noderivatives">
|
<label for="cc_noderivatives">
|
||||||
<input id="cc_noderivatives" type="radio" name="modification" value="noderivatives" />
|
<input id="cc_noderivatives" type="radio" name="modification" value="noderivatives" />
|
||||||
noderivatives
|
<strong>No</strong>, remixing is prohibited.
|
||||||
</label>
|
</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>
|
<legend>
|
||||||
Commercial ?
|
Is using the video for commercial purposes allowed ?
|
||||||
</legend>
|
</legend>
|
||||||
<label for="cc_commercial">
|
<label for="cc_commercial">
|
||||||
<input id="cc_commercial" type="radio" name="commercial" value="commercial" />
|
<input id="cc_commercial" type="radio" name="commercial" value="commercial" />
|
||||||
commercial
|
<strong>Yes</strong>, commercial use is allowed.
|
||||||
</label>
|
</label>
|
||||||
<label for="cc_noncommercial">
|
<label for="cc_noncommercial">
|
||||||
<input id="cc_noncommercial" type="radio" name="commercial" value="noncommercial" />
|
<input id="cc_noncommercial" type="radio" name="commercial" value="noncommercial" />
|
||||||
noncommercial
|
<strong>No</strong>, commercial use is prohibited.
|
||||||
</label>
|
</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue