ARLO Nester
Classes | Functions
workspace.tools.views.tag Namespace Reference

Classes

class  ViewTagForm
 

Functions

def tagInfo (tag)
 Build a dictionary of Tag data from a Tag object. More...
 
def getTagInfo (request, tagID)
 Web interface wrapper around tagInfo(). More...
 
def viewTag (request, tagID)
 Visualize an individual Tag and its properties. More...
 
def viewParentTag (request, tagID)
 Redirect to a Tag's parent. More...
 
def deleteTag (request, tagID)
 Delete a tag. More...
 
def acceptTag (request, tagID)
 
def getTagsInAudioSegment (request, audioID, startTime, endTime, minFrequency, maxFrequency)
 Get a list of tags from a media file that are within a search window. More...
 
def deleteAllInvalidTagExamples (request, projectId)
 Delete all Invaliduser tags for a Project. More...
 
def createUserTag (request, projectID, audioID)
 Create a user tag. More...
 
def navigateTags (request, projectID, audioID)
 Navigate through an audio file by jumping to the next, previous, first, or last tag. More...
 
def newCreateUserTag (request, projectId)
 
def adjustTag (request, tagId)
 Adjust the data of an existing tag. More...
 
def deleteTags (request, projectId)
 Web interface to delete tags. More...
 
def getDeleteTagList (formData)
 Given data from a DeleteTagsForm, generate the list of Tags that will be deleted. More...
 
def getDeleteTagCount (request, projectId)
 AJAX call used to count the number of tags that a delete operation will remove. More...
 

Function Documentation

def workspace.tools.views.tag.acceptTag (   request,
  tagID 
)
def workspace.tools.views.tag.adjustTag (   request,
  tagId 
)

Adjust the data of an existing tag.

Must be a POST request.

Note
NOTE: Currently this adjusts only the time / frequency, though it uses the NewCreateTagForm, which contains more data.
Parameters
requestthe Django HTTP request.
tagIDThe database ID of the tag to adjust
Returns
JSON dictionary indicating success / fail.
def workspace.tools.views.tag.createUserTag (   request,
  projectID,
  audioID 
)

Create a user tag.

Parameters
requestThe Django HTTP request. Must be a POST request
projectIdDatabase ID of the Project
audioID
Returns
JSON encoded dictionary with 'Success' boolean and 'saveMessage'
def workspace.tools.views.tag.deleteAllInvalidTagExamples (   request,
  projectId 
)

Delete all Invaliduser tags for a Project.

Note: This is currently not working after the Cassandra updates.

Parameters
requestThe Django HTTP request object
projectIDThe database ID of the Project from which to delete all user tags.
Returns
Django HTTP response object.
def workspace.tools.views.tag.deleteTag (   request,
  tagID 
)

Delete a tag.

Parameters
requestThe Django HTTP request object
tagIDThe database ID of the tag to delete
Returns
HTTP response object
def workspace.tools.views.tag.deleteTags (   request,
  projectId 
)

Web interface to delete tags.

A GET will will display the DeleteTagsForm, and the subsequent POST will perform the actual delete. This presents a form that allows the user to filter tags to deleted.

Parameters
requestThe Django HTTP request object
projectIdThe database ID of the Project.
Returns
Django HTTP response object
def workspace.tools.views.tag.getDeleteTagCount (   request,
  projectId 
)

AJAX call used to count the number of tags that a delete operation will remove.

Must be a GET request containing DeleteTagsForm data.

Parameters
requestThe Django HTTP request object
projectIdThe database ID of the Project.
Returns
A JSON encoded dictionary with the tag count {'count'}
def workspace.tools.views.tag.getDeleteTagList (   formData)

Given data from a DeleteTagsForm, generate the list of Tags that will be deleted.

Parameters
formDataData from a DeleteTagsForm (form.cleaned_data)
Returns
A QuerySet of Tag objects
def workspace.tools.views.tag.getTagInfo (   request,
  tagID 
)

Web interface wrapper around tagInfo().

Parameters
requestThe Django HTTP request object
tagIDThe Database ID of the tag to retrieve
Returns
A JSON encoded dictionary or the tagInfo() return
def workspace.tools.views.tag.getTagsInAudioSegment (   request,
  audioID,
  startTime,
  endTime,
  minFrequency,
  maxFrequency 
)

Get a list of tags from a media file that are within a search window.

i Tags need not be fully contained in the window; if any part of the tag is within the window it will be returned. Also, tags will be filtered for user permissions, i.e., the tags must be part of a project that the user has access to.

Parameters
requestThe Django request object
audioIDThe database ID of the audio file
startTimeThe start time of the search window. Seconds from the start of the file
endTimeThe end time of the search window. Seconds from the start of the file
minFrequencyThe minimum Frequency of the search window (Hz)
maxFrequencyThe maximum Frequency of the search window (Hz)
Returns
JSON encoded list of dictionaries, each dictionary as retruned by tagInfo()
def workspace.tools.views.tag.navigateTags (   request,
  projectID,
  audioID 
)

Navigate through an audio file by jumping to the next, previous, first, or last tag.

Expects a POST request with a NavigateTagClassForm. Return is a JSON dictionary, on success, {'success', 'tagID', 'startTime', 'endTime', 'userTagged', 'machineTagged'}. On error, {'success', 'errorMessage'}

Parameters
requestthe Django HTTP request.
audioIDThe database id of the AudioFile
Returns
JSON dictionary. form settings
def workspace.tools.views.tag.newCreateUserTag (   request,
  projectId 
)
def workspace.tools.views.tag.tagInfo (   tag)

Build a dictionary of Tag data from a Tag object.

Parameters
tagA Tag object
Returns
A dictionary of data for the tag.
def workspace.tools.views.tag.viewParentTag (   request,
  tagID 
)

Redirect to a Tag's parent.

Parameters
requestThe Django HTTP request object
tagIDThe database ID of the child Tag
Returns
Django HTTP Response, redirect to the parent tag.
def workspace.tools.views.tag.viewTag (   request,
  tagID 
)

Visualize an individual Tag and its properties.

GET request views the tag, POST updates the Tag data.

Parameters
requestThe Django HTTP Request.
tagIDThe database ID of the tag to visualize.
Returns
Django HTTP response