Contains the ApplicationsettingsController and its auxiliary functions.
Generate responses to requests on application settings resources.
REST Controller styled on the Atom Publishing Protocol.
The most recently created application settings resource is considered to be the active one.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Note
Only administrators are authorized to create, update or delete application settings resources.
Create a new application settings resource and return it.
| Url : | POST /applicationsettings |
|---|---|
| Request body: | JSON object representing the application settings to create. |
| Returns: | the newly created application settings. |
Delete an existing application settings and return it.
| Url : | DELETE /applicationsettings/id |
|---|---|
| Parameters: | id (str) – the id value of the application settings to be deleted. |
| Returns: | the deleted application settings model. |
Return an application settings and the data needed to update it.
| Url : | GET /applicationsettings/edit with optional query string parameters |
|---|---|
| Parameters: | id (str) – the id value of the application settings that will be updated. |
| Returns: | a dictionary of the form:{"applicationSettings": {...}, "data": {...}}
where the value of the applicationSettings key is a dictionary representation of the application settings and the value of the data key is a dictionary containing the objects necessary to update an application settings, viz. the return value of ApplicationsettingsController.new(). |
Note
This action can be thought of as a combination of ApplicationsettingsController.show() and ApplicationsettingsController.new(). See getNewApplicationSettingsData() to understand how the query string parameters can affect the contents of the lists in the data dictionary.
Get all application settings resources.
| Url : | GET /applicationsettings |
|---|---|
| Returns: | a list of all application settings resources. |
Return the data necessary to create a new application settings.
| Url : | GET /applicationsettings/new with optional query string parameters |
|---|---|
| Returns: | A dictionary of lists of resources |
Note
See getNewApplicationSettingsData() to understand how the query string parameters can affect the contents of the lists in the returned dictionary.
Return an application settings.
| Url : | GET /applicationsettings/id |
|---|---|
| Parameters: | id (str) – the id value of the application settings to be returned. |
| Returns: | an application settings model object. |
Update an application settings and return it.
| Url : | PUT /applicationsettings/id |
|---|---|
| Request body: | JSON object representing the application settings with updated attribute values. |
| Parameters: | id (str) – the id value of the application settings to be updated. |
| Returns: | the updated application settings model. |
Create a new application settings.
| Parameters: | data (dict) – the application settings to be created. |
|---|---|
| Returns: | an SQLAlchemy model object representing the application settings. |
Return the data necessary to create a new application settings or update an existing one.
| Parameters: | GET_params – the request.GET dictionary-like object generated by Pylons which contains the query string parameters of the request. |
|---|---|
| Returns: | A dictionary whose values are lists of objects needed to create or update application settings. |
If GET_params has no keys, then return all required data. If GET_params does have keys, then for each key whose value is a non-empty string (and not a valid ISO 8601 datetime) add the appropriate list of objects to the return dictionary. If the value of a key is a valid ISO 8601 datetime string, add the corresponding list of objects only if the datetime does not match the most recent datetimeModified value of the resource. That is, a non-matching datetime indicates that the requester has out-of-date data.
Update an application settings.
| Parameters: |
|
|---|---|
| Returns: | the updated application settings model or, if changed has not been set to True, then False. |
Contains the CollectionbackupsController.
Generate responses to requests on collection backup resources.
REST Controller styled on the Atom Publishing Protocol.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Note
Collection backups are created when updating and deleting collections; they cannot be created directly and they should never be deleted. This controller facilitates searching and getting of collection backups only.
Get all collection backup resources.
| Url : | GET /collectionbackups |
|---|---|
| Returns: | a list of all collection backup resources. |
Return the data necessary to search the collection backup resources.
| Url : | GET /collectionbackups/new_search |
|---|---|
| Returns: | {"searchParameters": {"attributes": { ... }, "relations": { ... }} |
Return the list of collection backup resources matching the input JSON query.
| Url : | SEARCH /collectionbackups (or POST /collectionbackups/search) |
|---|---|
| Request body: | A JSON object of the form: {"query": {"filter": [ ... ], "orderBy": [ ... ]},
"paginator": { ... }}
where the orderBy and paginator attributes are optional. |
Contains the ElicitationmethodsController and its auxiliary functions.
Generate responses to requests on elicitation method resources.
REST Controller styled on the Atom Publishing Protocol.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Create a new elicitation method resource and return it.
| Url : | POST /elicitationmethods |
|---|---|
| Request body: | JSON object representing the elicitation method to create. |
| Returns: | the newly created elicitation method. |
Delete an existing elicitation method and return it.
| Url : | DELETE /elicitationmethods/id |
|---|---|
| Parameters: | id (str) – the id value of the elicitation method to be deleted. |
| Returns: | the deleted elicitation method model. |
Return an elicitation method and the data needed to update it.
| Url : | GET /elicitationmethods/edit with optional query string parameters |
|---|---|
| Parameters: | id (str) – the id value of the elicitation method that will be updated. |
| Returns: | a dictionary of the form:{"elicitationMethod": {...}, "data": {...}}
where the value of the elicitationMethod key is a dictionary representation of the elicitation method and the value of the data key is a dictionary containing the objects necessary to update an elicitation method, viz. {}. |
Get all elicitation method resources.
| Url : | GET /elicitationmethods with optional query string parameters for ordering and pagination. |
|---|---|
| Returns: | a list of all elicitation method resources. |
Note
See utils.addOrderBy() and utils.addPagination() for the query string parameters that effect ordering and pagination.
Return the data necessary to create a new elicitation method.
| Url : | GET /elicitationmethods/new |
|---|---|
| Returns: | an empty dictionary |
Return an elicitation method.
| Url : | GET /elicitationmethods/id |
|---|---|
| Parameters: | id (str) – the id value of the elicitation method to be returned. |
| Returns: | an elicitation method model object. |
Update an elicitation method and return it.
| Url : | PUT /elicitationmethods/id |
|---|---|
| Request body: | JSON object representing the elicitation method with updated attribute values. |
| Parameters: | id (str) – the id value of the elicitation method to be updated. |
| Returns: | the updated elicitation method model. |
Create a new elicitation method.
| Parameters: | data (dict) – the elicitation method to be created. |
|---|---|
| Returns: | an SQLAlchemy model object representing the elicitation method. |
Update an elicitation method.
| Parameters: |
|
|---|---|
| Returns: | the updated elicitation method model or, if changed has not been set to True, False. |
Contains the ErrorController.
Generate JSON error objects as required.
The StatusCodeRedirect middleware forwards to ErrorController when error-related status codes are returned from the application.
This behaviour can be altered by changing the parameters to the StatusCodeRedirect middleware in the config/middleware.py file.
Return a JSON object representing the error.
Instead of returning an HTML error document (the Pylons default), return the JSON object that the controller has specified for the response body. If the response body is not valid JSON, then it has been created by Routes; make it into valid JSON.
Contains the FilesController and its auxiliary functions.
Generate responses to requests on file resources.
REST Controller styled on the Atom Publishing Protocol.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Create a new file resource and return it.
| Url : | POST /files |
|---|---|
| Request body: | JSON object or conventional POST parameters containing the attribute values of the new file. |
| Content type: | application/json or multipart/form-data. |
| Returns: | the newly created file. |
Note
There are three types of file and four types of file creation request.
Delete an existing file and return it.
| Url : | DELETE /files/id |
|---|---|
| Parameters: | id (str) – the id value of the file to be deleted. |
| Returns: | the deleted file model. |
Note
Only administrators and a file’s enterer can delete it.
Return a file and the data needed to update it.
| Url : | GET /files/edit with optional query string parameters |
|---|---|
| Parameters: | id (str) – the id value of the file that will be updated. |
| Returns: | a dictionary of the form:{"file": {...}, "data": {...}}
where the value of the file key is a dictionary representation of the file and the value of the data key is a dictionary containing the objects necessary to update a file, viz. the return value of FilesController.new() |
Note
This action can be thought of as a combination of FilesController.show() and FilesController.new(). See getNewEditFileData() to understand how the query string parameters can affect the contents of the lists in the data dictionary.
Get all file resources.
| Url : | GET /files with optional query string parameters for ordering and pagination. |
|---|---|
| Returns: | a list of all file resources. |
Note
See utils.addOrderBy() and utils.addPagination() for the query string parameters that effect ordering and pagination.
Return the data necessary to create a new file.
| Url : | GET /files/new with optional query string parameters |
|---|---|
| Returns: | a dictionary of lists of resources. |
Note
See getNewEditFileData() to understand how the query string parameters can affect the contents of the lists in the returned dictionary.
Return the data necessary to search the file resources.
| Url : | GET /files/new_search |
|---|---|
| Returns: | {"searchParameters": {"attributes": { ... }, "relations": { ... }} |
Return the list of file resources matching the input JSON query.
| Url : | SEARCH /files (or POST /files/search) |
|---|---|
| Request body: | A JSON object of the form: {"query": {"filter": [ ... ], "orderBy": [ ... ]},
"paginator": { ... }}
where the orderBy and paginator attributes are optional. |
Return the file data (binary stream) of the file.
| Parameters: | id (str) – the id value of the file whose file data are requested. |
|---|
Return the reduced-size file data (binary stream) of the file.
| Parameters: | id (str) – the id value of the file whose reduced-size file data are requested. |
|---|
Add the standard metadata to the file model using the data dictionary.
| Parameters: |
|
|---|---|
| Returns: | the updated file model object. |
Create a local file using data from a Content-Type: application/json request.
| Parameters: |
|
|---|---|
| Returns: | an SQLAlchemy model object representing the file. |
Create an externally hosted file.
| Parameters: |
|
|---|---|
| Returns: | an SQLAlchemy model object representing the file. |
Optional keys of the data dictionary, not including the standard metadata ones, are name, password and MIMEtype.
Create a local file using data from a Content-Type: multipart/form-data request.
| Parameters: |
|
|---|---|
| Returns: | an SQLAlchemy model object representing the file. |
Note
The validator expects request.POST to encode list input via the formencode.variabledecode.NestedVariables format. E.g., a list of form id values would be provided as values to keys with names like 'forms-0', 'forms-1', 'forms-2', etc.
Create a subinterval-referencing file.
| Parameters: |
|
|---|---|
| Returns: | an SQLAlchemy model object representing the file. |
A value for data['name'] may also be supplied.
Delete a file model.
| Parameters: | file – a file model object to delete. |
|---|---|
| Returns: | None. |
This deletes the file model object from the database as well as any binary files associated with it that are stored on the filesystem.
Return the data necessary to create a new OLD file or update an existing one.
| Parameters: | GET_params – the request.GET dictionary-like object generated by Pylons which contains the query string parameters of the request. |
|---|---|
| Returns: | A dictionary whose values are lists of objects needed to create or update files. |
If GET_params has no keys, then return all relevant data lists. If GET_params does have keys, then for each key whose value is a non-empty string (and not a valid ISO 8601 datetime) add the appropriate list of objects to the return dictionary. If the value of a key is a valid ISO 8601 datetime string, add the corresponding list of objects only if the datetime does not match the most recent datetimeModified value of the resource. That is, a non-matching datetime indicates that the requester has out-of-date data.
Get a unique file path.
| Parameters: | filePath (str) – an absolute file path. |
|---|---|
| Returns: | a tuple whose first element is the open file object and whose second is the unique file path as a unicode string. |
Restrict the entire file if it is associated to restricted forms.
| Parameters: | file – a file model object. |
|---|---|
| Returns: | the file model object potentially tagged as “restricted”. |
Serve the content (binary data) of a file.
| Parameters: |
|
|---|
Update an externally hosted file model.
| Parameters: |
|
|---|---|
| Returns: | the file model or, if the file has not been updated, False. |
Update a local file model.
| Parameters: |
|
|---|---|
| Returns: | the file model or, if the file has not been updated, False. |
Update the standard metadata attributes of the input file.
| Parameters: |
|
|---|---|
| Returns: | a tuple whose first element is the file model and whose second is the boolean changed. |
Update a subinterval-referencing file model.
| Parameters: |
|
|---|---|
| Returns: | the file model or, if the file has not been updated, False. |
Contains the FormbackupsController.
Generate responses to requests on form backup resources.
REST Controller styled on the Atom Publishing Protocol.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Note
Form backups are created when updating and deleting forms; they cannot be created directly and they should never be deleted. This controller facilitates searching and getting of form backups only.
Get all form backup resources.
| Url : | GET /formbackups |
|---|---|
| Returns: | a list of all form backup resources. |
Return the data necessary to search the form backup resources.
| Url : | GET /formbackups/new_search |
|---|---|
| Returns: | {"searchParameters": {"attributes": { ... }, "relations": { ... }} |
Return the list of form backup resources matching the input JSON query.
| Url : | SEARCH /formbackups (or POST /formbackups/search) |
|---|---|
| Request body: | A JSON object of the form: {"query": {"filter": [ ... ], "orderBy": [ ... ]},
"paginator": { ... }}
where the orderBy and paginator attributes are optional. |
Contains the FormsController and its auxiliary functions.
Generate responses to requests on form resources.
REST Controller styled on the Atom Publishing Protocol.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Create a new form resource and return it.
| Url : | POST /forms |
|---|---|
| Request body: | JSON object representing the form to create. |
| Returns: | the newly created form. |
Delete an existing form and return it.
| Url : | DELETE /forms/id |
|---|---|
| Parameters: | id (str) – the id value of the form to be deleted. |
| Returns: | the deleted form model. |
Note
Only administrators and a form’s enterer can delete it.
Return a form and the data needed to update it.
| Url : | GET /forms/edit with optional query string parameters |
|---|---|
| Parameters: | id (str) – the id value of the form that will be updated. |
| Returns: | a dictionary of the form:{"form": {...}, "data": {...}}
where the value of the form key is a dictionary representation of the form and the value of the data key is a dictionary containing the objects necessary to update a form, viz. the return value of FormsController.new() |
Note
This action can be thought of as a combination of FormsController.show() and FormsController.new(). See getNewEditFormData() to understand how the query string parameters can affect the contents of the lists in the data dictionary.
Return the form with form.id==id and its previous versions.
| Url : | GET /forms/history/id |
|---|---|
| Parameters: | id (str) – a string matching the id or UUID value of the form whose history is requested. |
| Returns: | A dictionary of the form:{"form": { ... }, "previousVersions": [ ... ]}
where the value of the form key is the form whose history is requested and the value of the previousVersions key is a list of dictionaries representing previous versions of the form. |
Get all form resources.
| Url : | GET /forms with optional query string parameters for ordering and pagination. |
|---|---|
| Returns: | a list of all form resources. |
Note
See utils.addOrderBy() and utils.addPagination() for the query string parameters that effect ordering and pagination.
Return the data necessary to create a new form.
| Url : | GET /forms/new with optional query string parameters |
|---|---|
| Returns: | A dictionary of lists of resources |
Note
See getNewEditFormData() to understand how the query string parameters can affect the contents of the lists in the returned dictionary.
Return the data necessary to search the form resources.
| Url : | GET /forms/new_search |
|---|---|
| Returns: | {"searchParameters": {"attributes": { ... }, "relations": { ... }} |
Cause the logged in user to remember the forms referenced in the request body.
| Url : | POST /forms/remember |
|---|---|
| Request body: | A JSON object of the form {"forms": [ ... ]} where the value of the forms attribute is the array of form id values representing the forms that are to be remembered. |
| Returns: | A list of form id values corresponding to the forms that were remembered. |
Return the list of form resources matching the input JSON query.
| Url : | SEARCH /forms (or POST /forms/search) |
|---|---|
| Request body: | A JSON object of the form: {"query": {"filter": [ ... ], "orderBy": [ ... ]},
"paginator": { ... }}
where the orderBy and paginator attributes are optional. |
Return a form.
| Url : | GET /forms/id |
|---|---|
| Parameters: | id (str) – the id value of the form to be returned. |
| Returns: | a form model object. |
Update a form and return it.
| Url : | PUT /forms/id |
|---|---|
| Request body: | JSON object representing the form with updated attribute values. |
| Parameters: | id (str) – the id value of the form to be updated. |
| Returns: | the updated form model. |
Update the morphological analysis-related attributes of all forms.
That is, update the values of the morphemeBreakIDs, morphemeGlossIDs, syntacticCategoryString and breakGlossCategory attributes of every form in the database.
| Url : | PUT /forms/update_morpheme_references |
|---|---|
| Returns: | a list of ids corresponding to the forms where the update caused a change in the values of the target attributes. |
Warning
It should not be necessary to request the regeneration of morpheme references via this action since this should already be accomplished automatically by the calls to updateFormsContainingThisFormAsMorpheme on all successful update, create and delete requests on form resources. This action is, therefore, deprecated (read: use it with caution) and may be removed in future versions of the OLD.
Backup a form.
| Parameters: |
|
|---|---|
| Returns: | None |
An error-handling wrapper arround compileMorphemicAnalysis_().
Catch any error, log it and return a default 4-tuple.
| Parameters: |
|
|---|---|
| Returns: | the output of compileMorphemicAnalysis_() or, if an error occurs, a 4-tuple of None objects. |
Generate values fo the morphological analysis-related attributes of a form model.
| Parameters: |
|
|---|---|
| Returns: | a 4-tuple containing the generated values or all four None objects if no values can be generated. |
Generate values for the morphemeBreakIDs, morphemeGlossIDs, syntacticCategoryString and breakGlossCategory attributes of the input form.
For each morpheme detected in the form, search the database for forms whose morphemeBreak value matches the morpheme’s phonemic form and whose morphemeGloss value matches the morpheme’s gloss. If a perfect match is not found, searc the database for forms matching just the phonemic form or just the gloss.
Matching forms are represented as triples where the first element is the id value of the match, the second is its morphemeBreak or morphemeGloss value and the third is its syntacticCategory.name value. To illustrate, consider a form with morphemeBreak value u’chien-s’ and morphemeGloss value u’dog-PL’ and assume the lexical entries ‘chien/dog/N/33’, ‘s/PL/Agr/103’ and ‘s/PL/Num/111’ (where, for /a/b/c/d, a is the morphemeBreak value, b is the morphemeGloss value, c is the syntacticCategory.name value and d is the id value. Running compileMorphemicAnalysis() on the target form returns the following 4-tuple q:
(
json.dumps([[[[33, u'dog', u'N']], [[111, u'PL', u'Num'], [103, u'PL', u'Agr']]]]),
json.dumps([[[[33, u'chien', u'N']], [[111, u's', u'Num'], [103, u's', u'Agr']]]]),
u'N-Num',
u'chien|dog|N-s|PL|Num'
)
where q[0] is the morphemeBreakIDs value, q[1] is the morphemeGlossIDs value, q[2] is syntacticCategoryString value and q[3] is breakGlossCategory value.
If kwargs contains a ‘lexicalItems’ or a ‘deletedLexicalItems’ key, then compileMorphemicAnalysis() will update (i.e., not re-create) the 4 relevant values of the form using only the items in kwargs['lexicalItems'] or kwargs['deletedLexicalItems']. This facilitates lexical change percolation without massively redundant database queries.
Create a new form.
| Parameters: | data (dict) – the form to be created. |
|---|---|
| Returns: | an SQLAlchemy model object representing the form. |
Return a form and its previous versions.
| Parameters: | id (str) – the id or UUID value of the form whose history is requested. |
|---|---|
| Returns: | a tuple whose first element is the form model and whose second element is a list of form backup models. |
Return the data necessary to create a new OLD form or update an existing one.
| Parameters: | GET_params – the request.GET dictionary-like object generated by Pylons which contains the query string parameters of the request. |
|---|---|
| Returns: | A dictionary whose values are lists of objects needed to create or update forms. |
If GET_params has no keys, then return all data, i.e., grammaticalities, speakers, etc. If GET_params does have keys, then for each key whose value is a non-empty string (and not a valid ISO 8601 datetime) add the appropriate list of objects to the return dictionary. If the value of a key is a valid ISO 8601 datetime string, add the corresponding list of objects only if the datetime does not match the most recent datetimeModified value of the resource. That is, a non-matching datetime indicates that the requester has out-of-date data.
Update the transcription validation functionality of the active application settings if the input form is a foreign word.
| Parameters: | form – a form model object |
|---|---|
| Returns: | None |
Update all collections that reference the input form in their contents value.
When a form is deleted, it is necessary to update all collections whose contents value references the deleted form. The update removes the reference, recomputes the contentsUnpacked, html and forms attributes of the affected collection and causes all of these changes to percolate through the collection-collection reference chain.
| Parameters: | form – a form model object |
|---|---|
| Returns: | None |
Note
Getting the collections that reference this form by searching for those whose forms attribute contain it is not quite the correct way to do this because many of these collections will not directly reference this form – in short, this will result in redundant updates and backups.
Update a form model.
| Parameters: |
|
|---|---|
| Returns: | the updated form model or, if changed has not been set to True, then False. |
Update the morphological analysis-related attributes of every form containing the input form as morpheme.
Update the values of the morphemeBreadIDs, morphemeGlossIDs, syntacticCategoryString, and breakGlossCategory attributes of each form that contains the input form in its morphological analysis, i.e., each form whose morphemeBreak value contains the input form’s morphemeBreak value as a morpheme or whose morphemeGloss value contains the input form’s morphemeGloss line as a gloss. If the input form is not lexical (i.e., if it contains the space character or a morpheme delimiter), then no updates occur.
| Parameters: |
|
|---|---|
| Returns: | None |
Return True if the update from formDict to form has changed the morphological analysis of the form.
Update the morphological analysis-related attributes of a form model.
Attempt to update the values of the morphemeBreakIDs, morphemeGlossIDs, syntacticCategoryString and breakGlossCategory attributes of a form using only the lexical items specified in the list kwargs['lexicalItems'] or the list kwargs['deletedLexicalItems'].
| Parameters: |
|
|---|---|
| Returns: | the form if updated; else False. |
Update the morphological analysis-related attributes of a list of form models.
Attempt to update the values of the morphemeBreakIDs, morphemeGlossIDs, syntacticCategoryString and breakGlossCategory attributes of all forms in forms using only the lexical items specified in the list kwargs['lexicalItems'] or kwargs['deletedLexicalItems']. Whenever an update occurs, backup the form and commit the changes.
| Parameters: |
|
|---|---|
| Returns: | a list of form id values corresponding to the forms that have been updated. |
Contains the FormsearchesController.
Generate responses to requests on form search resources.
REST Controller styled on the Atom Publishing Protocol.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Create a new form search resource and return it.
| Url : | POST /formsearches |
|---|---|
| Request body: | JSON object representing the form search to create. |
| Returns: | the newly created form search. |
Delete an existing form search and return it.
| Url : | DELETE /formsearches/id |
|---|---|
| Parameters: | id (str) – the id value of the form search to be deleted. |
| Returns: | the deleted form search model. |
GET /formsearches/id/edit: Return the data necessary to update an existing OLD form search.
Get all form search resources.
| Url : | GET /formsearches with optional query string parameters for ordering and pagination. |
|---|---|
| Returns: | a list of all form search resources. |
Note
See utils.addOrderBy() and utils.addPagination() for the query string parameters that effect ordering and pagination.
Return the data necessary to search the form search resources.
| Url : | GET /formsearches/new_search |
|---|---|
| Returns: | {"searchParameters": {"attributes": { ... }, "relations": { ... }} |
Return the list of form search resources matching the input JSON query.
| Url : | SEARCH /formsearches (or POST /formsearches/search) |
|---|---|
| Request body: | A JSON object of the form: {"query": {"filter": [ ... ], "orderBy": [ ... ]},
"paginator": { ... }}
where the orderBy and paginator attributes are optional. |
Note
Yes, that’s right, you can search form searches. (No, you can’t search searches of form searches :)
Create a new form search.
| Parameters: | data (dict) – the form search to be created. |
|---|---|
| Returns: | an form search model object. |
Update a form search model.
| Parameters: |
|
|---|---|
| Returns: | the updated form search model or, if changed has not been set to True, then False. |
Contains the LanguagesController.
Generate responses to requests on language resources.
REST Controller styled on the Atom Publishing Protocol.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Note
The language table is populated from an ISO 639-3 file upon application setup. The language resouces are read-only. This controller facilitates searching and getting of languages resources.
Get all language resources.
| Url : | GET /languages |
|---|---|
| Returns: | a list of all language resources. |
Return the data necessary to search the language resources.
| Url : | GET /languages/new_search |
|---|---|
| Returns: | {"searchParameters": {"attributes": { ... }, "relations": { ... }} |
Return the list of language resources matching the input JSON query.
| Url : | SEARCH /languages (or POST /languages/search) |
|---|---|
| Request body: | A JSON object of the form: {"query": {"filter": [ ... ], "orderBy": [ ... ]},
"paginator": { ... }}
where the orderBy and paginator attributes are optional. |
Contains the LoginController.
Handles authentication-related functionality.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Session-based authentication.
| Url : | POST /login/authenticate |
|---|---|
| Request body: | A JSON object with "username" and "password" string values |
| Returns: | {"authenticated": True} on success, an error dictionary on failure. |
Contains the OldcollectionsController and its auxiliary functions.
Generate responses to requests on collection resources.
REST Controller styled on the Atom Publishing Protocol.
The collections controller is one of the more complex ones. A great deal of this complexity arised from the fact that collections can reference forms and other collections in the value of their contents attribute. The propagation of restricted tags and associated forms and the generation of the html from these contents-with-references, necessitates some complex logic for updates and deletions.
Warning
There is a potential issue with collection-collection reference. A restricted user can restrict their own collection A and that restriction would be propagated up the reference chain, possibly causing another collection B (that was not created by the updater) to become restricted. That is, collection-collection reference permits restricted users to indirectly restrict collections they would otherwise not be permitted to restrict. This will be bothersome to other restricted users since they will no longer be able to access the newly restricted collection B.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Create a new collection resource and return it.
| Url : | POST /collections |
|---|---|
| Request body: | JSON object representing the collection to create. |
| Returns: | the newly created collection. |
Delete an existing collection and return it.
| Url : | DELETE /collections/id |
|---|---|
| Parameters: | id (str) – the id value of the collection to be deleted. |
| Returns: | the deleted collection model. |
Note
Only administrators and a collection’s enterer can delete it.
Return a collection and the data needed to update it.
| Url : | GET /collections/edit with optional query string parameters |
|---|---|
| Parameters: | id (str) – the id value of the collection that will be updated. |
| Returns: | a dictionary of the form:{"collection": {...}, "data": {...}}
where the value of the collection key is a dictionary representation of the collection and the value of the data key is a dictionary containing the objects necessary to update a collection, viz. the return value of CollectionsController.new() |
Note
This action can be thought of as a combination of CollectionsController.show() and CollectionsController.new(). See getNewEditCollectionData() to understand how the query string parameters can affect the contents of the lists in the data dictionary.
Return a collection and its previous versions.
| Url : | GET /collections/history/id |
|---|---|
| Parameters: | id (str) – a string matching the id or UUID value of the collection whose history is requested. |
| Returns: | a dictionary of the form:{"collection": { ... }, "previousVersions": [ ... ]}
where the value of the collection key is the collection whose history is requested and the value of the previousVersions key is a list of dictionaries representing previous versions of the collection. |
Return the data necessary to create a new collection.
| Url : | GET /collections/new with optional query string parameters |
|---|---|
| Returns: | a dictionary of lists of resources. |
Note
See getNewEditCollectionData() to understand how the query string parameters can affect the contents of the lists in the returned dictionary.
Return the data necessary to search the collection resources.
| Url : | GET /collections/new_search |
|---|---|
| Returns: | {"searchParameters": {"attributes": { ... }, "relations": { ... }} |
Return the list of collection resources matching the input JSON query.
| Url : | SEARCH /collections (or POST /collections/search) |
|---|---|
| Request body: | A JSON object of the form: {"query": {"filter": [ ... ], "orderBy": [ ... ]},
"paginator": { ... }}
where the orderBy and paginator attributes are optional. |
Add a 'contentsUnpacked' value to values and return values.
| Parameters: |
|
|---|---|
| Returns: | values updated. |
Add a list of referenced form ids to values.
| Parameters: | values (dict) – data for creating or updating a collection |
|---|---|
| Returns: | values with a 'forms' key whose value is a list of id integers. |
Backup a collection.
| Parameters: |
|
|---|---|
| Returns: | None |
Create a new collection.
| Parameters: |
|
|---|---|
| Returns: | an SQLAlchemy model object representing the collection. |
Generate the contentsUnpacked value of a collection.
| Parameters: |
|
|---|---|
| Returns: | a unicode object as a value for the contentsUnpacked attribute of a collection model. |
Note
Circular, invalid and unauthorized reference chains are caught in the generation of collectionsReferenced.
Return the collection such that collection.id==collectionId.
If the collection does not exist or if user is not authorized to access it, raise an appropriate error.
| Parameters: |
|
|---|---|
| Returns: | a collection model object. |
Return a collection and its previous versions.
| Parameters: | id (str) – the id or UUID value of the collection whose history is requested. |
|---|---|
| Returns: | a tuple whose first element is the collection model and whose second element is a list of collection backup models. |
Return the collections (recursively) referenced by the input contents value.
That is, return all of the collections referenced in the input contents value, plus all of the collections referenced in those collections, etc.
| Parameters: |
|
|---|---|
| Returns: | a dictionary whose keys are collection id values and whose values are collection models. |
Get the immediately referenced collections of a collection.
| Parameters: |
|
|---|---|
| Returns: | a list of collection models; useful in determining whether directly referenced collections are restricted. |
Return all collections that recursively reference collection.
That is, return all collections that reference collection plus all collections that reference those referencing collections, etc.
| Parameters: |
|
|---|---|
| Returns: | a list of collection models. |
Return the contents value of the collection with collectionId as its id value.
| Parameters: |
|
|---|---|
| Returns: | the contents of a collection, or a warning message. |
Return the data necessary to create a new OLD collection or update an existing one.
| Parameters: | GET_params – the request.GET dictionary-like object generated by Pylons which contains the query string parameters of the request. |
|---|---|
| Returns: | A dictionary whose values are lists of objects needed to create or update collections. |
If GET_params has no keys, then return all data. If GET_params does have keys, then for each key whose value is a non-empty string (and not a valid ISO 8601 datetime) add the appropriate list of objects to the return dictionary. If the value of a key is a valid ISO 8601 datetime string, add the corresponding list of objects only if the datetime does not match the most recent datetimeModified value of the resource. That is, a non-matching datetime indicates that the requester has out-of-date data.
Return dict_[key], making sure it defaults to a unicode object.
Remove references to a collection from the contents value of another collection.
| Parameters: |
|
|---|---|
| Returns: | the modified contents string. |
Remove references to a form from the contents value of another collection.
| Parameters: |
|
|---|---|
| Returns: | the modified contents string. |
Update a collection model.
| Parameters: |
|
|---|---|
| Returns: | a 3-tuple where the second and third elements are invariable booleans indicating whether the collection has become restricted or has had its contents value changed as a result of the update, respectively. The first element is the updated collection or False of the no update has occurred. |
Update a collection based on the deletion of a form it references.
This function is called in the FormsController when a form is deleted. It is called on each collection that references the deleted form and the changes to each of those collections are propagated through all of the collections that reference them, and so on.
| Parameters: |
|
|---|---|
| Returns: | None. |
Update all collections that reference the input collection.
| Parameters: |
|
|---|---|
| Returns: | None |
Update the contents, contentsUnpacked, html and/or form attributes of every collection that references the input collection plus all of the collections that reference those collections, etc. This function is called upon successful update and delete requests.
If the contents of the collection have changed (i.e., kwargs['contents_changed']==True) , then retrieve all collections that reference collection and all collections that reference those referers, etc., and update their contentsUnpacked, html and forms attributes.
If the collection has been deleted (i.e., kwargs['deleted']==True), then recursively retrieve all collections referencing collection and update their contents, contentsUnpacked, html and forms attributes.
If collection has just been tagged as restricted (i.e., kwargs['restricted']==True), then recursively restrict all collections that reference it.
In all cases, update the datetimeModified value of every collection that recursively references collection.
Contains the OrthographiesController and its auxiliary functions.
Generate responses to requests on orthography resources.
REST Controller styled on the Atom Publishing Protocol.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Create a new orthography resource and return it.
| Url : | POST /orthographies |
|---|---|
| Request body: | JSON object representing the orthography to create. |
| Returns: | the newly created orthography. |
Delete an existing orthography and return it.
| Url : | DELETE /orthographies/id |
|---|---|
| Parameters: | id (str) – the id value of the orthography to be deleted. |
| Returns: | the deleted orthography model. |
Note
Contributors can only delete orthographies that are not used in the active application settings.
Return an orthography and the data needed to update it.
| Url : | GET /orthographies/edit |
|---|---|
| Parameters: | id (str) – the id value of the orthography that will be updated. |
| Returns: | a dictionary of the form:{"orthography": {...}, "data": {...}}
where the value of the orthography key is a dictionary representation of the orthography and the value of the data key is an empty dictionary. |
Get all orthography resources.
| Url : | GET /orthographies with optional query string parameters for ordering and pagination. |
|---|---|
| Returns: | a list of all orthography resources. |
Note
See utils.addOrderBy() and utils.addPagination() for the query string parameters that effect ordering and pagination.
Return the data necessary to create a new orthography.
| Url : | GET /orthographies/new |
|---|---|
| Returns: | an empty dictionary |
Return an orthography.
| Url : | GET /orthographies/id |
|---|---|
| Parameters: | id (str) – the id value of the orthography to be returned. |
| Returns: | an orthography model object. |
Update an orthography and return it.
| Url : | PUT /orthographies/id |
|---|---|
| Request body: | JSON object representing the orthography with updated attribute values. |
| Parameters: | id (str) – the id value of the orthography to be updated. |
| Returns: | the updated orthography model. |
Note
Contributors can only update orthographies that are not used in the active application settings.
Create a new orthography.
| Parameters: | data (dict) – the data for the orthography to be created. |
|---|---|
| Returns: | an SQLAlchemy model object representing the orthography. |
Update an orthography.
| Parameters: |
|
|---|---|
| Returns: | the updated orthography model or, if changed has not been set to True, False. |
Contains the PagesController and its auxiliary functions.
Generate responses to requests on page resources.
REST Controller styled on the Atom Publishing Protocol.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Create a new page resource and return it.
| Url : | POST /pages |
|---|---|
| Request body: | JSON object representing the page to create. |
| Returns: | the newly created page. |
Delete an existing page and return it.
| Url : | DELETE /pages/id |
|---|---|
| Parameters: | id (str) – the id value of the page to be deleted. |
| Returns: | the deleted page model. |
Return a page and the data needed to update it.
| Url : | GET /pages/edit |
|---|---|
| Parameters: | id (str) – the id value of the page that will be updated. |
| Returns: | a dictionary of the form:{"page": {...}, "data": {...}}
where the value of the page key is a dictionary representation of the page and the value of the data key is the list of valid markup language names. |
Get all page resources.
| Url : | GET /pages with optional query string parameters for ordering and pagination. |
|---|---|
| Returns: | a list of all page resources. |
Note
See utils.addOrderBy() and utils.addPagination() for the query string parameters that effect ordering and pagination.
Return the data necessary to create a new page.
| Url : | GET /pages/new. |
|---|---|
| Returns: | a dictionary containing the names of valid OLD markup languages. |
Contains the PhonologiesController and its auxiliary functions.
Generate responses to requests on phonology resources.
REST Controller styled on the Atom Publishing Protocol.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Create a new phonology resource and return it.
| Url : | POST /phonologies |
|---|---|
| Request body: | JSON object representing the phonology to create. |
| Returns: | the newly created phonology. |
Delete an existing phonology and return it.
| Url : | DELETE /phonologies/id |
|---|---|
| Parameters: | id (str) – the id value of the phonology to be deleted. |
| Returns: | the deleted phonology model. |
Return a phonology and the data needed to update it.
| Url : | GET /phonologies/edit |
|---|---|
| Parameters: | id (str) – the id value of the phonology that will be updated. |
| Returns: | a dictionary of the form:{"phonology": {...}, "data": {...}}
where the value of the phonology key is a dictionary representation of the phonology and the value of the data key is an empty dictionary. |
Get all phonology resources.
| Url : | GET /phonologies with optional query string parameters for ordering and pagination. |
|---|---|
| Returns: | a list of all phonology resources. |
Note
See utils.addOrderBy() and utils.addPagination() for the query string parameters that effect ordering and pagination.
Return the data necessary to create a new phonology.
| Url : | GET /phonologies/new. |
|---|---|
| Returns: | an empty dictionary. |
Create a new phonology.
| Parameters: | data (dict) – the data for the phonology to be created. |
|---|---|
| Returns: | an SQLAlchemy model object representing the phonology. |
Update a phonology.
| Parameters: |
|
|---|---|
| Returns: | the updated phonology model or, if changed has not been set to True, False. |
Contains the RememberedformsController and its auxiliary functions.
Generate responses to requests on remembered forms resources.
REST Controller styled on the Atom Publishing Protocol.
Note
Remembered forms is a pseudo-REST-ful resource. Remembered forms are stored in the userform many-to-many table (cf. model/user.py) which defines the contents of a user’s rememberedForms attribute (as well as the contents of a form’s memorizers attribute). A user’s remembered forms are not affected by requests to the user resource. Instead, the remembered forms resource handles modification, retrieval and search of a user’s remembered forms.
Overview of the interface:
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Return the remembered forms of a user that match the input JSON query.
| Url : | SEARCH /rememberedforms/id (or POST /rememberedforms/id/search). |
|---|---|
| Parameters: | id (str) – the id value of the user whose remembered forms are searched. |
| Request body: | A JSON object of the form: {"query": {"filter": [ ... ], "orderBy": [ ... ]},
"paginator": { ... }}
where the orderBy and paginator attributes are optional. |
Return a user’s remembered forms.
| Url : | GET /rememberedforms/id with optional query string parameters for ordering and pagination. |
|---|---|
| Parameters: | id (str) – the id value of a user model. |
| Returns: | a list form models. |
Note
Any authenticated user is authorized to access this resource. Restricted forms are filtered from the array on a per-user basis.
Note
See utils.addOrderBy() and utils.addPagination() for the query string parameters that effect ordering and pagination.
Update a user’s remembered forms and return them.
| Url : | PUT /rememberedforms/id |
|---|---|
| Request body: | JSON object of the form {"forms": [...]} where the array contains the form id values that will constitute the user’s rememberedForms collection after update. |
| Parameters: | id (str) – the id value of the user model whose rememberedForms attribute is to be updated. |
| Returns: | the list of remembered forms of the user. |
Note
Administrators can update any user’s remembered forms; non-administrators can only update their own.
Contains the SourcesController and its auxiliary functions.
Generate responses to requests on source resources.
REST Controller styled on the Atom Publishing Protocol.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Create a new source resource and return it.
| Url : | POST /sources |
|---|---|
| Request body: | JSON object representing the source to create. |
| Returns: | the newly created source. |
Delete an existing source and return it.
| Url : | DELETE /sources/id |
|---|---|
| Parameters: | id (str) – the id value of the source to be deleted. |
| Returns: | the deleted source model. |
Return a source and the data needed to update it.
| Url : | GET /sources/edit |
|---|---|
| Parameters: | id (str) – the id value of the source that will be updated. |
| Returns: | a dictionary of the form:{"source": {...}, "data": {...}}
where the value of the source key is a dictionary representation of the source and the value of the data key is the list of BibTeX entry types. |
Get all source resources.
| Url : | GET /sources with optional query string parameters for ordering and pagination. |
|---|---|
| Returns: | a list of all source resources. |
Note
See utils.addOrderBy() and utils.addPagination() for the query string parameters that effect ordering and pagination.
Return the data necessary to create a new source.
| Url : | GET /sources/new. |
|---|---|
| Returns: | a dictionary containing the valid BibTeX entry types. |
Return the data necessary to search the source resources.
| Url : | GET /sources/new_search |
|---|---|
| Returns: | {"searchParameters": {"attributes": { ... }, "relations": { ... }} |
Return the list of source resources matching the input JSON query.
| Url : | SEARCH /sources (or POST /sources/search) |
|---|---|
| Request body: | A JSON object of the form: {"query": {"filter": [ ... ], "orderBy": [ ... ]},
"paginator": { ... }}
where the orderBy and paginator attributes are optional. |
Return a source.
| Url : | GET /sources/id |
|---|---|
| Parameters: | id (str) – the id value of the source to be returned. |
| Returns: | a source model object. |
Note
A source associated to a restricted file will still return a subset of the restricted file’s metadata. However, restricted users will be unable to retrieve the file data of the file because of the authorization logic in the retrieve action of the files controller.
Contains the SpeakersController and its auxiliary functions.
Generate responses to requests on speaker resources.
REST Controller styled on the Atom Publishing Protocol.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Create a new speaker resource and return it.
| Url : | POST /speakers |
|---|---|
| Request body: | JSON object representing the speaker to create. |
| Returns: | the newly created speaker. |
Delete an existing speaker and return it.
| Url : | DELETE /speakers/id |
|---|---|
| Parameters: | id (str) – the id value of the speaker to be deleted. |
| Returns: | the deleted speaker model. |
Return a speaker resource and the data needed to update it.
| Url : | GET /speakers/edit |
|---|---|
| Parameters: | id (str) – the id value of the speaker that will be updated. |
| Returns: | a dictionary of the form:{"speaker": {...}, "data": {...}}
where the value of the speaker key is a dictionary representation of the speaker and the value of the data key is an empty dictionary. |
Get all speaker resources.
| Url : | GET /speakers with optional query string parameters for ordering and pagination. |
|---|---|
| Returns: | a list of all speaker resources. |
Note
See utils.addOrderBy() and utils.addPagination() for the query string parameters that effect ordering and pagination.
Return the data necessary to create a new speaker.
| Url : | GET /speakers/new. |
|---|---|
| Returns: | an empty dictionary. |
Contains the SyntacticcategoriesController and its auxiliary functions.
Generate responses to requests on syntactic category resources.
REST Controller styled on the Atom Publishing Protocol.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Create a new syntactic category resource and return it.
| Url : | POST /syntacticcategorys |
|---|---|
| Request body: | JSON object representing the syntactic category to create. |
| Returns: | the newly created syntactic category. |
Delete an existing syntactic category and return it.
| Url : | DELETE /syntacticcategorys/id |
|---|---|
| Parameters: | id (str) – the id value of the syntactic category to be deleted. |
| Returns: | the deleted syntactic category model. |
Return a syntactic category resource and the data needed to update it.
| Url : | GET /syntacticcategorys/edit |
|---|---|
| Parameters: | id (str) – the id value of the syntactic category that will be updated. |
| Returns: | a dictionary of the form:{"syntacticCategory": {...}, "data": {...}}
where the value of the syntacticCategory key is a dictionary representation of the syntactic category and the value of the data key is a dictionary of valid syntactic category types as defined in onlinelinguisticdatabase.lib.utils. |
Get all syntactic category resources.
| Url : | GET /syntacticcategorys with optional query string parameters for ordering and pagination. |
|---|---|
| Returns: | a list of all syntactic category resources. |
Note
See utils.addOrderBy() and utils.addPagination() for the query string parameters that effect ordering and pagination.
Return the data necessary to create a new syntactic category.
| Url : | GET /syntacticcategorys/new. |
|---|---|
| Returns: | a dictionary containing the valid syntactic category types as defined in onlinelinguisticdatabase.lib.utils. |
Return a syntactic category.
| Url : | GET /syntacticcategorys/id |
|---|---|
| Parameters: | id (str) – the id value of the syntactic category to be returned. |
| Returns: | a syntactic category model object. |
Update a syntactic category and return it.
| Url : | PUT /syntacticcategorys/id |
|---|---|
| Request body: | JSON object representing the syntactic category with updated attribute values. |
| Parameters: | id (str) – the id value of the syntactic category to be updated. |
| Returns: | the updated syntactic category model. |
Create a new syntactic category.
| Parameters: | data (dict) – the data for the syntactic category to be created. |
|---|---|
| Returns: | an SQLAlchemy model object representing the syntactic category. |
Update all forms that reference a syntactic category.
| Parameters: | syntacticCategory – a syntactic category model object. |
|---|---|
| Returns: | None |
Note
This function is only called when a syntactic category is deleted or when its name is changed.
Update a syntactic category.
| Parameters: |
|
|---|---|
| Returns: | the updated syntactic category model or, if changed has not been set to True, False. |
Contains the TagsController and its auxiliary functions.
Generate responses to requests on tag resources.
REST Controller styled on the Atom Publishing Protocol.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Create a new tag resource and return it.
| Url : | POST /tags |
|---|---|
| Request body: | JSON object representing the tag to create. |
| Returns: | the newly created tag. |
Delete an existing tag and return it.
| Url : | DELETE /tags/id |
|---|---|
| Parameters: | id (str) – the id value of the tag to be deleted. |
| Returns: | the deleted tag model. |
Return a tag resource and the data needed to update it.
| Url : | GET /tags/edit |
|---|---|
| Parameters: | id (str) – the id value of the tag that will be updated. |
| Returns: | a dictionary of the form:{"tag": {...}, "data": {...}}
where the value of the tag key is a dictionary representation of the tag and the value of the data key is an empty dictionary. |
Get all tag resources.
| Url : | GET /tags with optional query string parameters for ordering and pagination. |
|---|---|
| Returns: | a list of all tag resources. |
Note
See utils.addOrderBy() and utils.addPagination() for the query string parameters that effect ordering and pagination.
Return the data necessary to create a new tag.
| Url : | GET /tags/new. |
|---|---|
| Returns: | an empty dictionary. |
Return a tag.
| Url : | GET /tags/id |
|---|---|
| Parameters: | id (str) – the id value of the tag to be returned. |
| Returns: | a tag model object. |
Update a tag and return it.
| Url : | PUT /tags/id |
|---|---|
| Request body: | JSON object representing the tag with updated attribute values. |
| Parameters: | id (str) – the id value of the tag to be updated. |
| Returns: | the updated tag model. |
Create a new tag.
| Parameters: | data (dict) – the data for the tag to be created. |
|---|---|
| Returns: | an SQLAlchemy model object representing the tag. |
Update a tag.
| Parameters: |
|
|---|---|
| Returns: | the updated tag model or, if changed has not been set to True, False. |
Contains the UsersController and its auxiliary functions.
Generate responses to requests on user resources.
REST Controller styled on the Atom Publishing Protocol.
Note
The h.jsonify decorator converts the return value of the methods to JSON.
Create a new user resource and return it.
| Url : | POST /users |
|---|---|
| Request body: | JSON object representing the user to create. |
| Returns: | the newly created user. |
Note
Only administrators are authorized to create users.
Delete an existing user and return it.
| Url : | DELETE /users/id |
|---|---|
| Parameters: | id (str) – the id value of the user to be deleted. |
| Returns: | the deleted user model. |
Return a user resource and the data needed to update it.
| Url : | GET /users/edit |
|---|---|
| Parameters: | id (str) – the id value of the user that will be updated. |
| Returns: | a dictionary of the form:{"user": {...}, "data": {...}}
where the value of the user key is a dictionary representation of the user and the value of the user key is a dictionary of lists of resources. |
Note
See getNewUserData() to understand how the query string parameters can affect the contents of the lists in the returned dictionary.
Get all user resources.
| Url : | GET /users with optional query string parameters for ordering and pagination. |
|---|---|
| Returns: | a list of all user resources. |
Note
See utils.addOrderBy() and utils.addPagination() for the query string parameters that effect ordering and pagination.
Return the data necessary to create a new user.
| Url : | GET /users/new with optional query string parameters . |
|---|---|
| Returns: | a dictionary of lists of resources. |
Note
See getNewUserData() to understand how the query string parameters can affect the contents of the lists in the returned dictionary.
Create a new user.
| Parameters: | data (dict) – the data for the user to be created. |
|---|---|
| Returns: | an SQLAlchemy model object representing the user. |
Return the data necessary to create a new OLD user or update an existing one.
| Parameters: | GET_params – the request.GET dictionary-like object generated by Pylons which contains the query string parameters of the request. |
|---|---|
| Returns: | A dictionary whose values are lists of objects needed to create or update user. |
If GET_params has no keys, then return all data. If GET_params does have keys, then for each key whose value is a non-empty string (and not a valid ISO 8601 datetime) add the appropriate list of objects to the return dictionary. If the value of a key is a valid ISO 8601 datetime string, add the corresponding list of objects only if the datetime does not match the most recent datetimeModified value of the resource. That is, a non-matching datetime indicates that the requester has out-of-date data.
Modules containing functionality used by numerous other modules.
This module defines SQLAQueryBuilder. An SQLAQueryBuilder instance is used to build an SQLAlchemy query object from a Python data structure (nested lists).
The two public methods are getSQLAQuery and getSQLAFilter. Both take a list representing a filter expression as input. getSQLAQuery returns an SQLAlchemy query object, including joins and filters. getSQLAFilter returns an SQLAlchemy filter expression and is called by getSQLAQuery. Errors in the Python filter expression will cause custom OLDSearchParseErrors to be raised.
The searchable models and their attributes (scalars & collections) are defined in SQLAQueryBuilder.schema.
Simple filter expressions are lists with four or five items. Complex filter expressions are constructed via lists whose first element is one of the boolean keywords ‘and’, ‘or’, ‘not’ and whose second element is a filter expression or a list thereof (in the case of ‘and’ and ‘or’). The examples below show a filter expression accepted by SQLAQueryBuilder(‘Form’).getSQLAQuery on the second line followed by the equivalent SQLAlchemy ORM expression. Note that the target model of the SQLAQueryBuilder is set to ‘Form’ so all queries will be against the Form model.
Simple scalar queries:
['Form', 'transcription', 'like', '%a%']
Session.query(Form).filter(Form.transcription.like(u'%a%'))
Scalar relations:
['Form', 'enterer', 'firstName', 'regex', '^[JS]']
Session.query(Form).filter(Form.enterer.has(User.firstName.op('regexp')(u'^[JS]')))
Scalar relations presence/absence:
['Form', 'enterer', '=', 'None']
Session.query(Form).filter(Form.enterer==None)
Collection relations (w/ SQLA’s collection.any() method):
['Form', 'files', 'id', 'in', [1, 2, 33, 5]]
Session.query(Form).filter(Form.files.any(File.id.in_([1, 2, 33, 5])))
Collection relations (w/ joins; should return the same results as (4)):
[‘File’, ‘id’, ‘in’, [1, 2, 33, 5]] fileAlias = aliased(File) Session.query(Form).filter(fileAlias.id.in_([1, 2, 33, 5])).outerjoin(fileAlias, Form.files)
Collection relations presence/absence:
['Form', 'files', '=', None]
Session.query(Form).filter(Form.files == None)
Negation:
['not', ['Form', 'transcription', 'like', '%a%']]
Session.query(Form).filter(not_(Form.transcription.like(u'%a%')))
Conjunction:
['and', [['Form', 'transcription', 'like', '%a%'],
['Form', 'elicitor', 'id', '=', 13]]]
Session.query(Form).filter(and_(Form.transcription.like(u'%a%'),
Form.elicitor.has(User.id==13)))
Disjunction:
['or', [['Form', 'transcription', 'like', '%a%'],
['Form', 'dateElicited', '<', '2012-01-01']]]
Session.query(Form).filter(or_(Form.transcription.like(u'%a%'),
Form.dateElicited < datetime.date(2012, 1, 1)))
Complex:
['and', [['Translation', 'transcription', 'like', '%1%'],
['not', ['Form', 'morphemeBreak', 'regex', '[28][5-7]']],
['or', [['Form', 'datetimeModified', '<', '2012-03-01T00:00:00'],
['Form', 'datetimeModified', '>', '2012-01-01T00:00:00']]]]]
translationAlias = aliased(Translation)
Session.query(Form).filter(and_(
translationAlias.transcription.like(u'%1%'),
not_(Form.morphemeBreak.op('regexp')(u'[28][5-7]')),
or_(
Form.datetimeModified < ...,
Form.datetimeModified > ...
)
)).outerjoin(translationAlias, Form.translations)
Note also that SQLAQueryBuilder detects the RDBMS and issues collate commands where necessary to ensure that pattern matches are case-sensitive while ordering is not.
A further potential enhancement would be to allow doubly relational searches, e.g., return all forms whose enterer has remembered a form with a transcription like ‘a’:
Scalar’s collection relations:
['Form', 'enterer', 'rememberedForms', 'transcription', 'like', '%a%']
Session.query(Form).filter(Form.enterer.has(User.rememberedForms.any(
Form.transcription.like('%1%'))))
Generate an SQLAlchemy query object from a Python dictionary.
Builds SQLAlchemy queries from Python data structures representing arbitrarily complex filter expressions. Joins are inferred from the filter expression. The public method most likely to be used is getSQLAQuery(). Example usage:
queryBuilder = SQLAlchemyQueryBuilder()
pythonQuery = {'filter': [
'and', [
['Translation', 'transcription', 'like', '1'],
['not', ['Form', 'morphemeBreak', 'regex', '[28][5-7]']],
['or', [
['Form', 'datetimeModified', '<', '2012-03-01T00:00:00'],
['Form', 'datetimeModified', '>', '2012-01-01T00:00:00']]]]]}
query = queryBuilder.getSQLAQuery(pythonQuery)
forms = query.all()


Connect to GERMANIC LANGUAGES in the Course Register.
GERMANIC LANGUAGES
GRMN-101 ELEMENTARY GERMAN I 1 CU 001 SAYILI-HURLEY S LEC MTWRF 11-12NOON WILL 24 MAX: 20 002 SAYILI-HURLEY S LEC MTWRF 12-1PM WILL 316 MAX: 20 GRMN-102 ELEMENTARY GERMAN II 1 CU 001 LEC MTWRF 11-12NOON WILL 303 JOHNSON L MAX: 20 002 LEC MTWRF 12-1PM WILL 24 BREITKOPF F MAX: 20 003 LEC MWF 1-2PM WILL 220 KONTULAINEN E LEC TR 1:30-2:30PM WILL 220 MAX: 20 GRMN-103 INTERMEDIATE GERMAN I 1 CU 001 LEC MTWR 11-12NOON DRLB 2C8 UCA D MAX: 20 002 LEC MW 12-1PM WILL 203 MADIN A LEC TR 12-1PM WILL 203 MAX: 20 GRMN-104 INTERMEDIATE GERMAN II 1 CU 001 LEC MTWR 11-12NOON WILL 201 LYNN C MAX: 20 002 LEC MTWR 12-1PM WILL 201 LYNN C MAX: 20 003 LEC TR 1:30-2:30PM WILL 205 LYNN C LEC MW 1-2PM WILL 205 MAX: 20 GRMN-107 ACCELERATED INTERMD GRMN 2 CU SEE SPECIAL MESSAGE IN DEPARTMENT HEADER 401 LEC TR 10:30-12NOON WILL 215 JAMES D LEC MWF 11-12NOON WILL 215 CROSS LISTED: GRMN-514 MAX W/CROSS LIST: 20 GRMN-180 GERMAN IN RESIDENCE 0.5 CU 001 LEC TBA ZAMBON K MAX: 30 GRMN-203 TEXTS AND CONTEXTS 1 CU 401 LEC MWF 10-11AM WILL 201 SAYILI-HURLEY S CROSS LISTED: GRMN-506 MAX W/CROSS LIST: 20 GRMN-220 BUSINESS GERMAN: MICRO 1 CU 001 LEC TR 9-10:30AM WILL 29 JAMES D FOREIGN LANG ACROSS CURRICULUM (FLAC) CRSE MAX: 30 GRMN-253 FREUD 1 CU REGISTRATION REQUIRED FOR LEC, REC HUMANITIES & SOCIAL SCIENCE SECTOR 402 LEC TR 10:30-12NOON STIT B21 WEISSBERG L ALL READINGS AND LECTURES IN ENGLISH CROSS LISTED: COML-253 ENGL-105 GSWS-252 HIST-253 MAX W/CROSS LIST: 86 RECITATION 0 CU 403 REC F 10-11AM WILL 741 DASBACH J CROSS LISTED: COML-253 ENGL-105 GSWS-252 HIST-253 MAX W/CROSS LIST: 14 404 REC F 11-12NOON WILL 304 NELSON D CROSS LISTED: COML-253 ENGL-105 GSWS-252 HIST-253 MAX W/CROSS LIST: 20 405 REC F 12-1PM WILL 305 LEWIS J CROSS LISTED: COML-253 ENGL-105 GSWS-252 HIST-253 MAX W/CROSS LIST: 20 406 REC F 11-12NOON WILL 301 DASBACH J CROSS LISTED: COML-253 ENGL-105 GSWS-252 HIST-253 MAX W/CROSS LIST: 12 407 REC F 12-1PM WILL 304 NELSON D CROSS LISTED: COML-253 ENGL-105 GSWS-252 HIST-253 MAX W/CROSS LIST: 12 408 REC F 1-2PM WILL 318 LEWIS J CROSS LISTED: COML-253 ENGL-105 GSWS-252 HIST-253 MAX W/CROSS LIST: 12 GRMN-256 THE DEVIL'S PACT LIT 1 CU REGISTRATION REQUIRED FOR LEC, REC ARTS & LETTERS SECTOR 401 LEC T 1:30-3PM GLAB 101 RICHTER S ALL READINGS AND LECTURES IN ENGLISH CROSS LISTED: CINE-352 COML-241 RELS-236 RUSS-188 MAX W/CROSS LIST: 40 GRMN-256 RECITATION 0 CU 402 REC R 1:30-3PM CHEM 119 RICHTER S ALL READINGS AND LECTURES IN ENGLISH CROSS LISTED: CINE-352 COML-241 RELS-236 RUSS-188 MAX W/CROSS LIST: 20 403 REC R 1:30-3PM PSYL C41 TEARNEY T ALL READINGS AND LECTURES IN ENGLISH CROSS LISTED: CINE-352 COML-241 RELS-236 RUSS-188 MAX W/CROSS LIST: 20 GRMN-264 TRANSLATING CULTURES 1 CU ARTS & LETTERS SECTOR BENJAMIN FRANKLIN SEMINARS CROSS CULTURAL ANALYSIS 401 SEM TR 12-1:30PM WILL 27 HELLERSTEIN K ALL READINGS AND LECTURES IN ENGLISH CROSS LISTED: COML-260 JWST-264 MAX W/CROSS LIST: 20 GRMN-301 HANDSCHRIFT-HYPERTEXT 1 CU 401 LEC MWF 10-11AM WILL 438 FLEISHMAN I CROSS LISTED: COML-301 MAX W/CROSS LIST: 30 GRMN-364 UNHUMAN ENCOUNTERS 1 CU 301 SEM TR 1:30-3PM DRLB 3N6 DAYIOGLU-YUCEL MAX: 30 GRMN-399 INDEPENDENT STUDY 1 CU 000 IND TBA STAFF SEE DEPT. FOR SECTION NUMBERS PERMISSION NEEDED FROM DEPARTMENT GRMN-402 SENIOR THESIS 1 CU 000 IND TBA STAFF PERMISSION NEEDED FROM DEPARTMENT SEE DEPT. FOR SECTION NUMBERS GRMN-403 SENIOR COLLOQUIUM 0.5 CU PERMISSION NEEDED FROM DEPARTMENT 301 SEM TBA STAFF MAX: 15 GRMN-499 INDEPENDENT STUDY 1 CU 000 IND TBA STAFF PERMISSION NEEDED FROM DEPARTMENT SEE DEPT. FOR SECTION NUMBERS GRMN-501 ELEMENTARY GERMAN I 1 CU 001 LEC TBA JAMES D UNDERGRADUATES NEED PERMISSION MAX: 5 002 LEC TBA JAMES D UNDERGRADUATES NEED PERMISSION MAX: 5 GRMN-502 ELEMENTARY GERMAN II 1 CU 001 LEC TBA STAFF UNDERGRADUATES NEED PERMISSION MAX: 5 GRMN-506 TEXTS AND CONTEXTS 1 CU 401 LEC MWF 10-11AM WILL 201 SAYILI-HURLEY S CROSS LISTED: GRMN-203 MAX W/CROSS LIST: 20 GRMN-509 JEWISH WOMEN WRITERS 1 CU 401 SEM R 3:30-5:30PM WILL 217 HELLERSTEIN K UNDERGRADUATES NEED PERMISSION ALL READINGS AND LECTURES IN ENGLISH CROSS LISTED: COML-509 ENGL-591 JWST-509 YDSH-509 MAX W/CROSS LIST: 30 GRMN-514 ACCELERATED INTERMD GRMN 2 CU SEE SPECIAL MESSAGE IN DEPARTMENT HEADER 401 LEC TR 10:30-12NOON WILL 215 JAMES D LEC MWF 11-12NOON WILL 215 CROSS LISTED: GRMN-107 MAX W/CROSS LIST: 20 GRMN-516 TEACHING METHODS 1 CU 301 SEM TR 9-10:30AM WILL 318 FREI C UNDERGRADUATES NEED PERMISSION MAX: 16 GRMN-527 PHILOSOPHY OF PSYCHOLOGY 1 CU 401 SEM R 3-6PM COHN 493 HATFIELD G UNDERGRADUATES NEED PERMISSION ALL READINGS AND LECTURES IN ENGLISH CROSS LISTED: PHIL-526 MAX W/CROSS LIST: 15 GRMN-532 GERM LIT 18C - PRESENT 1 CU 301 DAYIOGLU-YUCEL SEM TR 10:30-12NOON WILL 843 UNDERGRADUATES NEED PERMISSION MAX: 20 GRMN-555 HISTORY OF HUMAN VOICE 1 CU 401 SEM R 1:30-4:30PM DRLB 2N36 HOEGAERTS J UNDERGRADUATES NEED PERMISSION CROSS LISTED: COML-532 DTCH-530 HIST-531 MAX W/CROSS LIST: 20 GRMN-580 NIETZSCHE 1 CU 401 SEM M 3-5PM WILL 319 FLEISHMAN I UNDERGRADUATES NEED PERMISSION ALL READINGS AND LECTURES IN ENGLISH CROSS LISTED: COML-582 PHIL-480 MAX W/CROSS LIST: 28 GRMN-581 ORIGINS OFJEWISH STUDIES 1 CU 402 SEM W 10-12NOON TBA WEISSBG/WEITZMN ALL READINGS AND LECTURES IN ENGLISH UNDERGRADUATES NEED PERMISSION CONTACT DEPT or INSTRUCTOR FOR CLASSRM INFO CROSS LISTED: COML-584 JWST-490 MAX W/CROSS LIST: 20 GRMN-678 REALISM: LIT AND THEORY 1 CU 301 SEM T 3-5PM WILL 28 WEISSBERG L MAX: 30 GRMN-684 AFTER IDEALISM 1 CU 401 SEM W 3:30-6:30PM DRLB 3C2 KENNEDY E ALL READINGS AND LECTURES IN ENGLISH UNDERGRADUATES NEED PERMISSION CROSS LISTED: COML-684 PSCI-684 MAX W/CROSS LIST: 18 GRMN-990 MASTERS THESIS 1 CU SEE DEPT. FOR SECTION NUMBERS 000 MST TBA STAFF PERMISSION NEEDED FROM DEPARTMENT GRMN-995 DISSERTATION 1 CU SEE DEPT. FOR SECTION NUMBERS 000 DIS TBA STAFF PERMISSION NEEDED FROM DEPARTMENT GRMN-999 INDEPENDENT STUDY 1 CU SEE DEPT. FOR SECTION NUMBERS 000 IND TBA STAFF PERMISSION NEEDED FROM DEPARTMENT
Return to Course & Room Roster
Comments to:
Office of the University Registrar
University of Pennsylvania
Room 221 Franklin Building
3451 Walnut Street
Philadelphia, PA 19104-6291
Phone:<PHONE_NUMBER> Fax:<PHONE_NUMBER>
<EMAIL_ADDRESS>Updated: Sat Jan 17 08:30:02 2015


Exhibit 21.1
Civitas Solutions, Inc.
Subsidiaries
|
Subsidiary |
State of Incorporation/ Organization |
Name(s) under which doing business |
||
| Adult Day Health, Inc. | Delaware |
CapeVerdian Adult Day Health Haitian Adult Day Health Joyful Living ADH New England ADH Oasis Zabota Community Center |
||
| California Mentor Family Home Agency, LLC | Delaware | |||
| CareMeridian, LLC | Delaware | CareMeridian - Buffalo | ||
| Center for Comprehensive Services, Inc. | Illinois |
Ann Arbor Rehabilitation Centers NeuroRestorative Avalon Park NeuroRestorative Carbondale Community Links NeuroRestorative Florida NeuroRestorative Illinois NeuroRestorative Kentucky NeuroRestorative Maryland NeuroRestorative Massachusetts NeuroRestorative Michigan NeuroRestorative National Capitol NeuroRestorative Tennessee |
||
| Cornerstone Living Skills, Inc. | California | |||
| Family Advocacy Services, LLC | Delaware | New Visions Academy | ||
| First Step Independent Living Program, Inc. | California | |||
| Horrigan Cole Enterprises, Inc. | California | Cole Vocational Services | ||
| Illinois Mentor Community Services, Inc. | Delaware | |||
| Illinois Mentor, Inc. | Illinois | |||
| Institute for Family Centered Services, Inc. | Virginia |
California Mentor Florida Mentor IFCS of Maryland a/k/a Institute for Family Centered Services |
||
| North Carolina Mentor | ||||
|
Ohio Mentor Tennessee Mentor |
||||
| Loyds Liberty Homes, Inc. | California | |||
| Massachusetts Mentor, LLC | Delaware | NeuroRestorative Massachusetts | ||
| Mentor ABI, LLC | Delaware | Hammond Place | ||
| NeuroRestorative | ||||
| NeuroRestorative Arkansas | ||||
| NeuroRestorative Georgia | ||||
| NeuroRestorative Louisiana | ||||
| NeuroRestorative Maine | ||||
| NeuroRestorative Indiana | ||||
| NeuroRestorative Iowa | ||||
| NeuroRestorative New Hampshire | ||||
| NeuroRestorative New Jersey | ||||
| NeuroRestorative North Carolina | ||||
| NeuroRestorative Ohio | ||||
| NeuroRestorative Pennsylvania | ||||
| NeuroRestorative Rhode Island | ||||
| NeuroRestorative San Antonio | ||||
| NeuroRestorative Texas | ||||
| NeuroRestorative Texas Twisted Oaks | ||||
| NeuroRestorative Timber Ridge | ||||
| NeuroRestorative Virginia |
| Mentor Management, Inc. | Delaware | |||
| Mentor Maryland, Inc. | Maryland | |||
| National Mentor Healthcare, LLC | Delaware | Alabama Mentor | ||
| Arizona Mentor | ||||
| California Mentor | ||||
| Creative Home Programs | ||||
| Delaware Mentor | ||||
| Family Advocacy Services | ||||
| Family Advocacy Services of Virginia | ||||
| Florida Mentor | ||||
| Georgia Mentor | ||||
| Indiana Mentor Adult Foster Care | ||||
| Indiana Mentor | ||||
| Institute for Family Centered Services | ||||
| Kentucky Mentor | ||||
| Louisiana Mentor | ||||
| Mississippi Mentor | ||||
| New Jersey Mentor | ||||
| North Carolina Mentor | ||||
| Pennsylvania Mentor | ||||
| Rhode Island Mentor | ||||
| Texas Mentor | ||||
| National Mentor Holdings, Inc. | Delaware | |||
| National Mentor Holdings, LLC | Delaware | |||
| National Mentor Services Holdings, LLC | Delaware | |||
| National Mentor Services, LLC | Delaware | Kansas Mentor | ||
|
Mentor Oregon Missouri Mentor |
||||
| National Mentor, LLC | Delaware | |||
| NMH Holdings, LLC | Delaware | |||
| Ohio Mentor, Inc. | Ohio | Institute for Family Center Services | ||
| Progressive Living Units Systems New Jersey, Inc. | New Jersey |
NeuroRestorative New Jersey PLUS |
||
| REM Arrowhead, Inc. | Minnesota | |||
| REM Central Lakes, Inc. | Minnesota | |||
| REM Community Options, LLC | West Virginia | |||
| REM Connecticut Community Services, Inc. | Connecticut | |||
| REM Developmental Services, Inc. | Iowa | |||
| REM East, LLC | Delaware | REM Virginia, REM Mississippi | ||
| REM Heartland, Inc. | Minnesota | |||
| REM Hennepin, Inc. | Minnesota | |||
| REM Indiana Community Services, Inc. | Indiana | |||
| REM Indiana Community Services II, Inc. | Indiana | |||
| REM Indiana, Inc. | Indiana | |||
| REM Iowa Community Services, Inc. | Iowa | |||
| REM Iowa, Inc. | Iowa | |||
| REM Management, Inc. | Minnesota | |||
| REM Maryland, Inc. | Maryland | |||
| REM Minnesota Community Services, Inc. | Minnesota | |||
| REM Minnesota, Inc. | Minnesota | |||
| REM Nevada, Inc. | Nevada |
2
| REM New Jersey, Inc. | New Jersey | |||
| REM New Jersey Properties, Inc. | New Jersey | |||
| REM North Dakota, Inc. | North Dakota | |||
| REM North Star, Inc. | Minnesota | |||
| REM Occazio, Inc. | Indiana | Indiana Mentor | ||
| REM Ohio, Inc. | Ohio | |||
| REM Ohio Waivered Services, Inc. | Ohio | |||
| REM Ramsey, Inc. | Minnesota | |||
| REM River Bluffs, Inc. | Minnesota | |||
| REM South Central Services, Inc, | Minnesota | |||
| REM Southwest Services, Inc. | Minnesota | |||
| REM West Virginia, LLC | West Virginia | |||
| REM Wisconsin, Inc. | Wisconsin | NeuroRestorative Wisconsin | ||
| REM Wisconsin II, Inc. | Wisconsin | |||
| REM Wisconsin III, Inc. | Wisconsin | |||
| REM Woodvale, Inc. | Minnesota | |||
| South Carolina Mentor, Inc. | South Carolina | |||
| Transitional Services, LLC | Indiana | Indiana Mentor | ||
| Unlimited Quest, Inc. | California |
3


Teacher in court for killing pupil, baby
by GEORGE ODIWUORIn Summary
- The primary school teacher has been charged with allegedly murdering his pupil and her 10-month-old baby whom he allegedly sired after defiling the girl.
- The suspect allegedly killed the minor and buried her body in a shallow grave near his home before strangling the baby and throwing her body in a bush.
- Mr Ooko is alleged to have committed the offence in an attempt to interfere with the defilement case he was facing at Mbita law court in which the pupil was the key witness.
A primary school teacher from Homa Bay County has been charged with murdering his pupil and her 10-month-old baby.
Mr Eric Otieno Ooko of Gethsemane Academy on Mfangano Island is accused of killing the class eight pupil and her baby, whom he allegedly sired.
It is alleged that the suspect committed the offence in order to interfere with witnesses in a defilement case he was facing at Mbita Law Courts.
Appearing before Homa Bay High Court Judge Justice Joseph Karanja, the suspect was charged with two counts of murder.
DEFILED PUPIL
Mr Ooko is reported to have impregnated the 13-year-old learner last year.
According to an affidavit signed by the Directorate of Criminal Investigations officer in charge of Mbita Sub-County Philip Sang, the suspect killed the minor and buried her body in a shallow grave near his home. Mr Ooko is alleged to have later strangled the baby and dumped her body in a bush within the same area.
The two bodies were later discovered by residents who were drawn to the site by a foul smell.
According to Mr Sang, the suspect committed the offence in an attempt to interfere with the defilement case he was facing at Mbita law court in which the pupil was the key witness.
GIRL'S DISAPPEARANCE
In the affidavit, the investigative officer indicated that the minor left her cousin's house with her baby to attend an antenatal clinic in Sindo Town on January 22 but she failed to return. Her whereabouts were not immediately established.
The disappearance of the pupil forced the court to withdraw the case due to lack of witness.
However before the withdrawal of the case, Mr Ooko was charged with conspiracy to interfere with witnesses.
He was to appear in court on April 11 but he absconded the proceeding, leading to issuance of an arrest warrant.
DENIED BOND
The suspect allegedly disappeared from his village after learning that the bodies had been discovered by villagers.
Mr Ooko was later arrested by DCI officials in his hideout at Obunga estate in Kisumu before being arraigned in court.
He denied the charges before Justice Karanja.
State council requested the court to deny the suspect bond on grounds of possible interference with witnesses in the case.
Justice Karanja ruled that he be remanded without bond, further directing the accused to apply for the bond at later stages of the case.
The case will be heard on April 6, 2020.


Framed is the genesis piece for Nifty Offset.
There are 3 coded or hidden messages within. One of the messages unlocks enough currency to offset 20 M/T of carbon or pay ETH gas fees for an artist who may need support in getting started. Alternatively, the finder could keep it and do nothing. The choice is theirs and that's the point.
Each day, we're faced with choices on how we'll interface with people and planet. As temperature and inequity rise, we can choose complacency or action.
If you've discovered the hidden currency and want to take action, here are a few we recommend:


Database is a crucial part of any softwares nowadays, especially mobile applications. We use database to store various things, such as:
app settings: to make it consistent between app launches.
app context: to perserve the last screen user visited. (in case the app was killed, either intentionally by the user or automatically by the system to reclaim memory)
data from a network reponse: to better support offline mode.
anything you want to save for later submission when network is available.
etc and etc…
Those are the things that make an app fast and responsive and eventually useful.
Therefore, we wanna make sure that our database works correctly. No mistakes or errors is tolerant here.
But how do we achieve that?
Well, you know, we write unit tests for it.
The database techonology I’m gonna use today is Realm. Although there are many other good alternatives out there that can do the job well, they’re just not as great as Realm. Here’s a couple of reasons why Realm is my database of choice:
It’s fast, like… extremely fast. Look at this chart: (Source: qiita)
It’s easy to use. The interface is very simple and swift-friendly. You can do all kinds of database operations with minimal efforts.
It’s open source, mostly.
If you encounter a bug, you can hop in and take a look at the underlying implementation. That would help you get an understanding of how things work and hopefully fix your bug.
If you find something that can be improved, you can work on it and open a Pull-Request to contribute back to Realm. That’s powerful.
Realm is late to the game but proves to be one of the best mobile databases in the market, if not the best, apparently.
However, we’re not gonna learn how to use Realm today. Instead, we will try to write unit tests for it.
We’re gonna write a lot and cover most of Realm features. It may take time so make sure you’re passionate about it.
When we’re testing, we may create/update or delete some records from the Realm database. We don’t want those changes to affect the production database. If we let that happens, it would become a disaster.
What we’re gonna do is we direct all Realm operations into a test database instead of the real one. Realm provides a very convenient way to do exactly just that.
This will point Realm to an in-memory database (namely “database A”) where we can freely experiment and do whatever we want. Since it’s in memory, it won’t affect the production database at all.
Now we need to call this Realm configuration line before any tests get executed. The ideal place is in the beforeSuite method:
Note: you can set the inMemoryIdentifier to anything as long as it’s not nil. In this case, I’m setting it to the Spec’s name so every Spec will use different in-memory database.
Additionally, we wanna clear out all records so that each test would start with a fresh empty database. Override the beforeEach and put in the code to delete everything within Realm:
We now have a clean and isolated testing environment. Let’s move on and write some real tests.
Let’s say we have a Person model with 2 properties: name and age.
We also have a custom initializer to quickly set those properites:
Now how do we test this intializer method?
Well, we do it in 2 steps:
Let’s go ahead and add the test to your Spec file: (PersonSpec.swift in this case)
Fill in the test body with 2 steps we mentioned above:
Run the test (Cmd + U) and make sure that it passes.
1.2. Test relationships:
To-One Relationships:
What we have:
Steps to test:
Create the test:
Fill in the test body:
Note that personName, personAge and dogName are just some constants defined elsewhere to make the code less duplicated.
To-Many Relationships:
What we have:
Steps to test:
Create the test:
Fill in the test body:
Inverse Relationships:
What we have:
Steps to test:
Create the test:
Fill in the test body:
1.3. Test ignored properties:
What we have:
Steps to test:
Create the test:
Fill in the test body:
Again, the personAddress and personHeight are just some constants defined elsewhere.
2. Testing CRUD operations:
2.1. Create:
What we have:
Steps to test:
Create the test:
Fill in the test body:
2.2. Read:
To read from database, we must have some data in it first. Let’s create a helper method to provide dummy data:
Retrieving all objects:
What we have:
Steps to test:
Create the test:
Fill in the test body:
Filtering:
What we have:
Steps to test:
Create the test:
Fill in the test body:
Sorting:
What we have:
Steps to test:
Create the test:
Fill in the test body:
2.3. Update:
Update properties:
What we have:
Steps to test:
Create the test:
Fill in the test body:
Update with primary key:
What we have:
Steps to test:
Context 1: different primary key (id)
Context 2: same primary key (id)
Create the test:
Fill in the test body:
2.4. Delete:
What we have:
Steps to test:
Create the test:
Wrap up
These are just some simple use cases of Realm. They serve as the building blocks for writing more complex ones.
In a real-world scenario, it might require a combination of multiple Realm operations at a time. However, the testing approach is basically the same. You can extend it very easily.


|
libcoap
4.3.0
|
The transmission parameters for CoAP rate control ("Congestion Control" in stream-oriented protocols) are defined in https://tools.ietf.org/html/rfc7252#section-4.8. More...
Macros | |
| #define | COAP_DEFAULT_ACK_TIMEOUT ((coap_fixed_point_t){2,0}) |
| Number of seconds when to expect an ACK or a response to an outstanding CON message. More... | |
| #define | COAP_DEFAULT_ACK_RANDOM_FACTOR ((coap_fixed_point_t){1,500}) |
| A factor that is used to randomize the wait time before a message is retransmitted to prevent synchronization effects. More... | |
| #define | COAP_DEFAULT_MAX_RETRANSMIT 4 |
| Number of message retransmissions before message sending is stopped RFC 7252, Section 4.8 Default value of MAX_RETRANSMIT is 4. More... | |
| #define | COAP_DEFAULT_NSTART 1 |
| The number of simultaneous outstanding interactions that a client maintains to a given server. More... | |
| #define | COAP_DEFAULT_LEISURE (5U) |
| The maximum number of seconds before sending back a response to a multicast request. More... | |
| #define | COAP_MAX_TRANSMIT_SPAN(s) |
| The MAX_TRANSMIT_SPAN definition for the session (s). More... | |
| #define | COAP_MAX_TRANSMIT_WAIT(s) |
| The MAX_TRANSMIT_WAIT definition for the session (s). More... | |
| #define | COAP_MAX_LATENCY 100 |
| The MAX_LATENCY definition. More... | |
| #define | COAP_PROCESSING_DELAY(s) |
| The PROCESSING_DELAY definition for the session (s). More... | |
| #define | COAP_MAX_RTT(s) ((2 * COAP_MAX_LATENCY) + COAP_PROCESSING_DELAY(s)) |
| The MAX_RTT definition for the session (s). More... | |
| #define | COAP_EXCHANGE_LIFETIME(s) (COAP_MAX_TRANSMIT_SPAN(s) + (2 * COAP_MAX_LATENCY) + COAP_PROCESSING_DELAY(s)) |
| The EXCHANGE_LIFETIME definition for the session (s). More... | |
| #define | COAP_NON_LIFETIME(s) (COAP_MAX_TRANSMIT_SPAN(s) + COAP_MAX_LATENCY) |
| The NON_LIFETIME definition for the session (s). More... | |
The transmission parameters for CoAP rate control ("Congestion Control" in stream-oriented protocols) are defined in https://tools.ietf.org/html/rfc7252#section-4.8.
| #define COAP_DEFAULT_ACK_RANDOM_FACTOR ((coap_fixed_point_t){1,500}) |
A factor that is used to randomize the wait time before a message is retransmitted to prevent synchronization effects.
RFC 7252, Section 4.8 Default value of ACK_RANDOM_FACTOR is 1.5
Configurable using coap_session_set_ack_random_factor()
Definition at line 412 of file coap_session.h.
| #define COAP_DEFAULT_ACK_TIMEOUT ((coap_fixed_point_t){2,0}) |
Number of seconds when to expect an ACK or a response to an outstanding CON message.
RFC 7252, Section 4.8 Default value of ACK_TIMEOUT is 2
Configurable using coap_session_set_ack_timeout()
Definition at line 403 of file coap_session.h.
| #define COAP_DEFAULT_LEISURE (5U) |
The maximum number of seconds before sending back a response to a multicast request.
RFC 7252, Section 4.8 DEFAULT_LEISURE is 5.
Definition at line 435 of file coap_session.h.
| #define COAP_DEFAULT_MAX_RETRANSMIT 4 |
Number of message retransmissions before message sending is stopped RFC 7252, Section 4.8 Default value of MAX_RETRANSMIT is 4.
Configurable using coap_session_set_max_retransmit()
Definition at line 420 of file coap_session.h.
| #define COAP_DEFAULT_NSTART 1 |
The number of simultaneous outstanding interactions that a client maintains to a given server.
RFC 7252, Section 4.8 Default value of NSTART is 1
Definition at line 427 of file coap_session.h.
| #define COAP_EXCHANGE_LIFETIME | ( | s | ) | (COAP_MAX_TRANSMIT_SPAN(s) + (2 * COAP_MAX_LATENCY) + COAP_PROCESSING_DELAY(s)) |
The EXCHANGE_LIFETIME definition for the session (s).
RFC 7252, Section 4.8.2 Calculation of EXCHANGE_LIFETIME MAX_TRANSMIT_SPAN + (2 * MAX_LATENCY) + PROCESSING_DELAY
Definition at line 495 of file coap_session.h.
| #define COAP_MAX_LATENCY 100 |
The MAX_LATENCY definition.
RFC 7252, Section 4.8.2 MAX_LATENCY is 100.
Definition at line 468 of file coap_session.h.
| #define COAP_MAX_RTT | ( | s | ) | ((2 * COAP_MAX_LATENCY) + COAP_PROCESSING_DELAY(s)) |
The MAX_RTT definition for the session (s).
RFC 7252, Section 4.8.2 Calculation of MAX_RTT (2 * MAX_LATENCY) + PROCESSING_DELAY
Definition at line 486 of file coap_session.h.
| #define COAP_MAX_TRANSMIT_SPAN | ( | s | ) |
The MAX_TRANSMIT_SPAN definition for the session (s).
RFC 7252, Section 4.8.2 Calculation of MAX_TRAMSMIT_SPAN ACK_TIMEOUT * ((2 ** (MAX_RETRANSMIT)) - 1) * ACK_RANDOM_FACTOR
Definition at line 444 of file coap_session.h.
| #define COAP_MAX_TRANSMIT_WAIT | ( | s | ) |
The MAX_TRANSMIT_WAIT definition for the session (s).
RFC 7252, Section 4.8.2 Calculation of MAX_TRAMSMIT_WAIT ACK_TIMEOUT * ((2 ** (MAX_RETRANSMIT + 1)) - 1) * ACK_RANDOM_FACTOR
Definition at line 457 of file coap_session.h.
| #define COAP_NON_LIFETIME | ( | s | ) | (COAP_MAX_TRANSMIT_SPAN(s) + COAP_MAX_LATENCY) |
The NON_LIFETIME definition for the session (s).
RFC 7252, Section 4.8.2 Calculation of NON_LIFETIME MAX_TRANSMIT_SPAN + MAX_LATENCY
Definition at line 504 of file coap_session.h.
| #define COAP_PROCESSING_DELAY | ( | s | ) |
The PROCESSING_DELAY definition for the session (s).
RFC 7252, Section 4.8.2 Calculation of PROCESSING_DELAY PROCESSING_DELAY set to ACK_TIMEOUT
Definition at line 476 of file coap_session.h.


Mary McAleese calls on Catholic Church to allow permanent women deacons
by By Digital Desk staffFormer president Mary McAleese has said allowing women to become permanent deacons would help end ‘embedded misogyny’ which ‘goes very deep in the church’
Speaking at Trinity College at an event called "The Women the Vatican couldn't silence" Ms McAleese said she welcomed the decision by the Pope to reopen the question of admitting women to the permanent diaconate.
RTE also report the former President welcomed a recent call by the Association of Catholic Priests in Ireland for the role of women to be enhanced within the church.
Permanent deacons are ordained men who support priests but can be married and have jobs to support their families. Deacons perform a range of tasks but do not say Mass.
READ MORE
Archbishop Diarmuid Martin pays tribute to Dr Richard Clarke as he announces retirement


Affiliate Payments
{{(paymentTotals.pending || 0) | currency: '$'}}
PENDING
{{(paymentTotals.holdback || 0) | currency: '$'}}
10% HOLDBACKS
{{(paymentTotals.ready || 0) | currency: '$'}}
READY TO PAY
{{(paymentTotals.paid || 0) | currency: '$'}}
TOTAL PAID
Commissions are released 2 weeks after the sale is made and are paid out the following Friday using your i-Payout (eWallet) account.
Your must have a minimum balance of at least $20 'ready to pay' in order to have your commissions sent to your e wallet account. We do
clawbacks on commissions up to 90 days in case of refunds or chargebacks.
| Date |
Notes |
Total |
|
{{payment.ledger_type == 'commissions' && 'Payout' || 'Refund'}} |
|
| --- No payments were found --- |


A mixed function oxidase enzyme which during hemoglobin catabolism catalyzes the degradation of heme to ferrous iron, carbon monoxide and biliverdin in the presence of molecular oxygen and reduced NADPH. The enzyme is induced by metals, particularly cobalt. (mesh:D006419)
| Synonym | Reference | Specificity |
| heme oxygenase | Exact | |
| haem oxygenase | Exact |
| Identifier | Name | Relation |
| HGNC:5013 | HMOX1 | isa |
| HGNC:5014 | HMOX2 | isa |


--- title: "Paragraph" type: typography scss: sass/modules/_typography.scss usage: "The HTML Paragraph Element represents a paragraph of text. Paragraphs are block-level elements." info: "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p" ---
Switzerland is small and neutral! We are more like Germany, ambitious and misunderstood! And then the battle's not so bad? With a warning label this big, you know they gotta be fun! Anyhoo, your net-suits will allow you to experience Fry's worm infested bowels as if you were actually wriggling through them. Good news, everyone! I've taught the toaster to feel love! And from now on you're all named Bender Jr.