Home Page Package¶
The home package contains the modules necessary to support the operation of the TerraNexus Web Application home page.
Home Page Submodules¶
The following submodules are defined by this package.
home.admin module¶
Note
Module Details
Home “admin” module
This module defines parameters and configuration for the site administration of the TerraNexus home page.
Created: 7 September 2017
@author: Dr. Matthew B.J. Purss
- class home.admin.HomeAdmin(model, admin_site)¶
Bases:
ModelAdmin
- fieldsets = [(None, {'fields': ['homepage_statement']}), (None, {'fields': ['show_record']}), ('Date information', {'classes': ['collapse'], 'fields': ['date_published']})]¶
- list_display = ['id', 'homepage_statement', 'show_record', 'date_published']¶
- list_filter = ['date_published']¶
- property media¶
- search_fields = ['homepage_statement']¶
home.apps module¶
Note
Module Details
Home Application Registration module
This Class module is required to register each Django package under the main web application.
Created: 7 September 2017
@author: Dr. Matthew B.J. Purss
home.models module¶
Note
Module Details
Home Model Definition Resource
This Class module is required to configure the base “model” that supports the TerraNexus homepage.
This is part of the Model View Controller (MVC) Architecture that underpins Django web applications.
For operational and security reasons the conventional “model” structure supported as standard by Django has been replaced with a mongodb version of this architecture.
This also enables management of the TerraNexus administration database in the same context as all other TerraNexus databases.
Created: 7 September 2017
@author: Dr. Matthew B.J. Purss
- class home.models.Home(id, homepage_statement, date_published, show_record)¶
Bases:
Model
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- clean()¶
Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.
- date_published¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_next_by_date_published(*, field=<django.db.models.fields.DateTimeField: date_published>, is_next=True, **kwargs)¶
- get_previous_by_date_published(*, field=<django.db.models.fields.DateTimeField: date_published>, is_next=False, **kwargs)¶
- homepage_statement¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- save(*args, **kwargs)¶
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- show_record¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
home.urls module¶
Note
Module Details
Home URL Configuration
The urlpatterns list routes URLs to views for the home package. For more information please see: Django Documentation - urls
Created: 7 September 2017
@author: Dr. Matthew B.J. Purss
home.views module¶
Note
Module Details
Home “Views” Module
This module prepares the views necessary to perform all tasks relevant to the TerraNexus homepage.
Created: 7 September 2017
@author: Dr. Matthew B.J. Purss
- home.views.health_status(request, *args, **kwargs)¶
Note
Function Details
TerraNexus Web Application Health Status Page. This is used during deployment of TerraNexus to test that the web application has deployed successfully.
- Parameters:
request (request-object) – The html request object.
- home.views.index(request, *args, **kwargs)¶
Note
Function Details
TerraNexus Web Application Home Page
- Parameters:
request (request-object) – The html request object.
- home.views.jsonld_context(request, *args, **kwargs)¶